Esempio n. 1
0
 def test_basic_key_value_pairs(self):
     data = (('a', 'b'), ('b', 'b'), ('c', 'c'))
     result = engine.normalize_schema(data)
     assert result == {0: ('a', 'b'), 1: ('b', 'b'), 2: ('c', 'c')}
Esempio n. 2
0
 def test_recurse_if_second_item_is_typle(self):
     data = ('a', ('a', 'b'))
     result = engine.normalize_schema(data)
     assert result == {0: ('a', {0: ('a', 'b')})}
Esempio n. 3
0
 def test_respect_more_than_two_values_in_tuple(self):
     data = ('a', (('a', 'b'), ('c', 'c'), ('d', 'd')))
     result = engine.normalize_schema(data)
     assert result == {0: ('a', {0: ('a', 'b'), 1: ('c', 'c'), 2: ('d', 'd')})}
Esempio n. 4
0
 def test_return_data_structure_with_cero_index(self):
     result = engine.normalize_schema(['a'])
     assert result == {0: ['a']}