示例#1
0
def test_initialize():
    with nt.assert_raises(SystemExit):
        api.initialize(['-h'])
    api.initialize(['--configuration_backend', 'json', '--tasks_json', 'a'])
    tj = stolos.get_NS().tasks_json
    api.initialize(['--configuration_backend', 'json', '--tasks_json', 'b'])
    tj2 = stolos.get_NS().tasks_json
    nt.assert_equal(tj, 'a')
    nt.assert_equal(tj2, 'b')
    nt.assert_false(hasattr(stolos, 'Uninitialized'))
示例#2
0
文件: test_api.py 项目: kszucs/stolos
def test_initialize():
    with nt.assert_raises(SystemExit):
        api.initialize(['-h'])
    api.initialize(['--configuration_backend', 'json', '--tasks_json', 'a'])
    tj = stolos.get_NS().tasks_json
    api.initialize(['--configuration_backend', 'json', '--tasks_json', 'b'])
    tj2 = stolos.get_NS().tasks_json
    nt.assert_equal(tj, 'a')
    nt.assert_equal(tj2, 'b')
    nt.assert_false(hasattr(stolos, 'Uninitialized'))
示例#3
0
def test_tasks_json():
    api.initialize(['--tasks_json', ''])
    with nt.assert_raises(IOError):
        JSONMapping()
示例#4
0
def test_tasks_json():
    api.initialize(['--tasks_json', ''])
    with nt.assert_raises(IOError):
        JSONMapping()