def test_no_prefix(self): sorted_keys = sorted(get_dotted_keys(self.test_dict)) self.assertEqual(sorted_keys, [ 'address', 'address.city', 'address.country', 'address.number', 'address.street', 'address.street.name', 'address.street.type', 'books', 'name', ])
def test_with_prefix(self): sorted_keys = sorted(get_dotted_keys(self.test_dict, 'data')) self.assertEqual(sorted_keys, [ 'data.address', 'data.address.city', 'data.address.country', 'data.address.number', 'data.address.street', 'data.address.street.name', 'data.address.street.type', 'data.books', 'data.name', ])