@@ -25,6 +25,23 @@ def build_test_env(test_name, yaml_file, enable_history=True):
25
25
return env
26
26
27
27
28
+ def eq_dict (dict1 , dict2 ):
29
+
30
+ for key in dict1 :
31
+ if key in dict2 :
32
+ if dict1 [key ] != dict2 [key ]:
33
+ return False
34
+ else :
35
+ assert False
36
+ return True
37
+
38
+ def in_dict (list_of_dicts , dict ):
39
+ for dict1 in list_of_dicts :
40
+ if eq_dict (dict1 , dict ):
41
+ return True
42
+ return False
43
+
44
+
28
45
def test_history_SinglePlayer_HasHistory (test_name ):
29
46
"""
30
47
Assuming there is a single avatar
@@ -122,7 +139,9 @@ def test_history_SinglePlayer_MultipleAction(test_name):
122
139
},
123
140
]
124
141
125
- assert info ["History" ] == expected_history
142
+ assert in_dict (info ["History" ], expected_history [0 ])
143
+ assert in_dict (info ["History" ], expected_history [1 ])
144
+
126
145
127
146
128
147
def test_history_MultiplePlayer_History (test_name ):
@@ -170,7 +189,8 @@ def test_history_MultiplePlayer_History(test_name):
170
189
},
171
190
]
172
191
173
- assert info ["History" ] == expected_history
192
+ assert in_dict (info ["History" ], expected_history [0 ])
193
+ assert in_dict (info ["History" ], expected_history [1 ])
174
194
175
195
176
196
def test_history_MultiplePlayer_MultipleAction_History (test_name ):
@@ -238,4 +258,6 @@ def test_history_MultiplePlayer_MultipleAction_History(test_name):
238
258
},
239
259
]
240
260
241
- assert info ["History" ] == expected_history
261
+ assert in_dict (info ["History" ], expected_history [0 ])
262
+ assert in_dict (info ["History" ], expected_history [1 ])
263
+ assert in_dict (info ["History" ], expected_history [2 ])
0 commit comments