示例#1
0
 def test_task_fail(self):
     '''none task must fail on error input'''
     try:
         invoke(composer.task(None), {'error': 'foo'})
         assert False
     except Exception as error:
         print(error)
示例#2
0
 def test_try_must_throw(self):
     activation = invoke(
         composer.do(composer.task(None), return_error_message),
         {'error': 'foo'})
     assert activation['response']['result'] == {'message': 'foo'}
示例#3
0
 def test_task_function(self):
     activation = invoke(composer.task(isEven), {'n': 4})
     assert activation['response']['result'] == {'value': True}
示例#4
0
 def test_task_none(self):
     activation = invoke(composer.task(None), {'foo': 'foo'})
     assert activation['response']['result'] == {'foo': 'foo'}
 def test_dict_invalid(self):
     try:
         composer.task({"foo": 42})
         assert False
     except composer.ComposerError as error:
         assert error.message.startswith('Invalid argument')
示例#6
0
 def test_task_action(self):
     activation = invoke(composer.task('isNotOne'), {'n': 0})
     assert activation['response']['result'] == {'value': True}
 def test_boolean_invalid(self):
     try:
         composer.task(False)
         assert False
     except composer.ComposerError as error:
         assert error.message.startswith('Invalid argument')
 def test_none(self):
     composer.task(None)
 def test_lambda(self):
     composer.task(lambda: {})
 def test_function(self):
     composer.task(empty)
 def test_string(self):
     composer.task('isNotOne')