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)
def test_try_must_throw(self): activation = invoke( composer.do(composer.task(None), return_error_message), {'error': 'foo'}) assert activation['response']['result'] == {'message': 'foo'}
def test_task_function(self): activation = invoke(composer.task(isEven), {'n': 4}) assert activation['response']['result'] == {'value': True}
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')
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')