def test_activity_step_input_template(self): step_data = { "name": "test", "activity": "test1", "requires": ["foo"], "input": ('{' '"a": {{foo}},' '"b": {{__input__}},' '"c": {{__input__.who}}' '}') } step = Step.from_data(step_data, self.activities) self.assertEquals( step.prepare({ "foo": "hello", "__input__": { "who": "world" } }), { 'a': 'hello', 'b': { 'who': 'world' }, 'c': 'world' } )
def test_activity_step_create(self): step_data = { "name": "test", "activity": "test1", } step = Step.from_data(step_data, self.activities) self.assertEquals(step.name, 'test') self.assertTrue(step.activity is self.activities['test1']) self.assertTrue(step.input_template is None)
def test_step_create_requires(self): step_data = { "name": "test", "activity": "test1", # Note: Not checking activity here "requires": ["foo", ("bar", "succeeded"), ("baz", "failed")], } step = Step.from_data(step_data, self.activities) self.assertEquals( step.requires, { 'foo': StepStateStatus.completed, 'bar': StepStateStatus.succeeded, 'baz': StepStateStatus.failed, } )