jamcodec 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jamcodec-0.1.3 → jamcodec-0.1.4}/PKG-INFO +1 -1
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/base.py +7 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/types.py +2 -2
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec.egg-info/PKG-INFO +1 -1
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_map.py +19 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/LICENSE +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/README.md +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/__init__.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/constants.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/exceptions.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec/mixins.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec.egg-info/SOURCES.txt +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec.egg-info/dependency_links.txt +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec.egg-info/requires.txt +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/jamcodec.egg-info/top_level.txt +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/pyproject.toml +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/requirements.txt +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/setup.cfg +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_array.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_bitarray.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_bitvec.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_boolean.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_bytes.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_compact.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_enum.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_float.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_hashmap.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_integer.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_mixins.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_option.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_scale_types.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_scalebytes.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_string.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_struct.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_tuple.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_varint.py +0 -0
- {jamcodec-0.1.3 → jamcodec-0.1.4}/test/test_vec.py +0 -0
|
@@ -115,6 +115,13 @@ class JamBytes:
|
|
|
115
115
|
return False
|
|
116
116
|
return self.data == other.data
|
|
117
117
|
|
|
118
|
+
|
|
119
|
+
def __lt__(self, other):
|
|
120
|
+
return self.data < other.data
|
|
121
|
+
|
|
122
|
+
def __gt__(self, other):
|
|
123
|
+
return self.data > other.data
|
|
124
|
+
|
|
118
125
|
def __len__(self):
|
|
119
126
|
return len(self.data)
|
|
120
127
|
|
|
@@ -977,8 +977,8 @@ class Map(JamCodecTypeDef):
|
|
|
977
977
|
# Convert to list
|
|
978
978
|
value = value.items()
|
|
979
979
|
|
|
980
|
-
# Sort Map by keys
|
|
981
|
-
value = sorted(value
|
|
980
|
+
# Sort Map by keys and then values
|
|
981
|
+
value = sorted(value)
|
|
982
982
|
|
|
983
983
|
# Encode length of Vec
|
|
984
984
|
data = VarInt64.encode(len(value))
|
|
@@ -56,6 +56,25 @@ class TestMap(unittest.TestCase):
|
|
|
56
56
|
data
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
+
def test_map_encode_sort_key_values(self):
|
|
60
|
+
obj = Map(U32, U32).new()
|
|
61
|
+
value = [
|
|
62
|
+
(2, 1),
|
|
63
|
+
(2, 2),
|
|
64
|
+
(1, 2),
|
|
65
|
+
(1, 1)
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
data = obj.encode(value)
|
|
69
|
+
|
|
70
|
+
self.assertEqual(
|
|
71
|
+
JamBytes(
|
|
72
|
+
"0x040100000001000000010000000200000002000000010000000200000002000000"
|
|
73
|
+
),
|
|
74
|
+
data
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
59
78
|
def test_map_decode(self):
|
|
60
79
|
obj = Map(U32, Bytes).new()
|
|
61
80
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|