@@ -36,17 +36,19 @@ def test_orchestration_state_output(context, output_state):
36
36
37
37
38
38
def assert_attribute_equal (expected , result , attribute ):
39
- if hasattr ( expected , attribute ) :
39
+ if attribute in expected :
40
40
assert expected .get (attribute ) == result .get (attribute )
41
41
else :
42
- assert not hasattr ( result , attribute )
42
+ assert attribute not in result
43
43
44
44
45
45
def assert_actions_are_equal (expected , result ):
46
46
expected_actions = expected .get ("actions" )
47
47
result_actions = result .get ("actions" )
48
48
assert len (expected_actions ) == len (result_actions )
49
49
for index in range (len (expected_actions )):
50
- assert expected_actions [index ][0 ]["functionName" ] == result_actions [index ][0 ]["functionName" ]
51
- assert expected_actions [index ][0 ]["input" ] == result_actions [index ][0 ]["input" ]
52
- assert expected_actions [index ][0 ]["actionType" ] == result_actions [index ][0 ]["actionType" ]
50
+ expected_action = expected_actions [index ][0 ]
51
+ result_action = result_actions [index ][0 ]
52
+ assert_attribute_equal (expected_action , result_action , "functionName" )
53
+ assert_attribute_equal (expected_action , result_action , "input" )
54
+ assert_attribute_equal (expected_action , result_action , "actionType" )
0 commit comments