Parent: [e42fa4] (diff)

Child: [3f60d2] (diff)

Download this file

test_commands.py    27 lines (20 with data), 723 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import mock
from nose.tools import assert_raises
from datadiff.tools import assert_equal
import pylons
from alluratest.controller import setup_basic_test, setup_global_objects
from allura.command import script
from allura import model as M
test_config = 'test.ini#main'
class EmptyClass(object): pass
def setUp(self):
"""Method called by nose before running each test"""
#setup_basic_test(app_name='main_with_amqp')
setup_basic_test()
setup_global_objects()
def test_script():
cmd = script.ScriptCommand('script')
cmd.args = [ test_config, 'allura/tests/tscript.py' ]
cmd.command()
cmd.args = [ test_config, 'allura/tests/tscript_error.py' ]
assert_raises(ValueError, cmd.command)