+ elif isinstance(expected, dict) and isinstance(got_dict.get(info_field, None), dict):
+ expect_dict(self, got_dict.get(info_field), expected)
+ elif isinstance(expected, list) and isinstance(got_dict.get(info_field, None), list):
+ got = got_dict.get(info_field, None)
+ self.assertEqual(len(expected), len(got),
+ 'Expect a list of length %d, but got a list of length %d' % (
+ len(expected), len(got)))
+ _id = 0
+ for i, j in zip(got, expected):
+ _type_i = type(i)
+ _type_j = type(j)
+ self.assertEqual(_type_j, _type_i,
+ 'Type doesn\'t match at element %d of the list in field %s, expect %s, got %s' % (
+ _id, info_field, _type_j, _type_i))
+ expect_dict(self, {'_': i}, {'_': j})
+ _id += 1