Skip to content

Commit ce9d2c8

Browse files
committed
Guarantee order of maps for unit test
1 parent 6bb0c53 commit ce9d2c8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unit/test_marshalling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,15 @@
7676
('\x00\x01\x00\x10\xafYC\xa3\xea<\x11\xe1\xabc\xc4,\x03"y\xf0', 'ListType(TimeUUIDType)', (UUID(bytes='\xafYC\xa3\xea<\x11\xe1\xabc\xc4,\x03"y\xf0'),)),
7777
)
7878

79+
ordered_dict_value = OrderedDict()
80+
ordered_dict_value[u'\u307fbob'] = 199
81+
ordered_dict_value[u''] = -1
82+
ordered_dict_value[u'\\'] = 0
83+
7984
# these following entries work for me right now, but they're dependent on
8085
# vagaries of internal python ordering for unordered types
8186
marshalled_value_pairs_unsafe = (
82-
('\x00\x03\x00\x06\xe3\x81\xbfbob\x00\x04\x00\x00\x00\xc7\x00\x00\x00\x04\xff\xff\xff\xff\x00\x01\\\x00\x04\x00\x00\x00\x00', 'MapType(UTF8Type, Int32Type)', OrderedDict({u'\u307fbob': 199, u'': -1, u'\\': 0})),
87+
('\x00\x03\x00\x06\xe3\x81\xbfbob\x00\x04\x00\x00\x00\xc7\x00\x00\x00\x04\xff\xff\xff\xff\x00\x01\\\x00\x04\x00\x00\x00\x00', 'MapType(UTF8Type, Int32Type)', ordered_dict_value),
8388
('\x00\x02\x00\x08@\x01\x99\x99\x99\x99\x99\x9a\x00\x08@\x14\x00\x00\x00\x00\x00\x00', 'SetType(DoubleType)', sortedset([2.2, 5.0])),
8489
('\x00', 'IntegerType', 0),
8590
)

0 commit comments

Comments
 (0)