protobin 0.1.0__tar.gz → 0.1.1__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.
- {protobin-0.1.0 → protobin-0.1.1}/PKG-INFO +2 -2
- {protobin-0.1.0 → protobin-0.1.1}/protobin/protocol.py +0 -1
- {protobin-0.1.0 → protobin-0.1.1}/pyproject.toml +1 -1
- {protobin-0.1.0 → protobin-0.1.1}/tests/tests.py +9 -1
- {protobin-0.1.0 → protobin-0.1.1}/.gitignore +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/LICENSE.txt +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/README.md +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/protobin/__init__.py +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/protobin/errors.py +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/protobin/fields.py +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/protobin/interfaces.py +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/protobin/singleton.py +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/tests/codec8.json +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/tests/demo.json +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/tests/demo.yaml +0 -0
- {protobin-0.1.0 → protobin-0.1.1}/tests/teltonika.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: protobin
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Python library for encode and decode data in protobin format
|
|
5
5
|
Project-URL: Homepage, https://github.com/drmelectronic/protobin-python
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/drmelectronic/protobin-python/issues
|
|
@@ -174,7 +174,6 @@ class Protocol:
|
|
|
174
174
|
length = int.from_bytes(binary[:self.length], 'big', signed=False)
|
|
175
175
|
clean_binary = binary[self.length:length + self.length]
|
|
176
176
|
crc = binary[length + self.length: length + self.length + self.crc_size]
|
|
177
|
-
print('length', binary[:self.length], 'binary', clean_binary, 'crc', crc)
|
|
178
177
|
crc_value = int.from_bytes(crc, self.crc_byteorder, signed=False)
|
|
179
178
|
if not crc:
|
|
180
179
|
raise CRCError(f'There is no CRC')
|
|
@@ -486,7 +486,15 @@ class BasicTest(unittest.TestCase):
|
|
|
486
486
|
binary = b'\x54\x44\x3d\x01\x99\x0A\x55\x5D\x8C'
|
|
487
487
|
h, recv = self.protocol.decode(binary)
|
|
488
488
|
print('edu', recv)
|
|
489
|
-
self.assertEqual(data['test'].replace(microsecond=(data['test'].microsecond // 1000) * 1000), recv['test'])
|
|
489
|
+
self.assertEqual(data['test'].replace(microsecond=(data['test'].microsecond // 1000) * 1000), recv['test'] + datetime.timedelta(hours=))
|
|
490
|
+
|
|
491
|
+
def test_check_format(self):
|
|
492
|
+
format1 = self.protocol.formats.get('date')
|
|
493
|
+
print('test_check_format', format1)
|
|
494
|
+
format2 = self.protocol.get_format(b'D')
|
|
495
|
+
print('test_check_format', format2)
|
|
496
|
+
self.assertEqual(format1, format2)
|
|
497
|
+
|
|
490
498
|
|
|
491
499
|
class AdvancedTest(unittest.TestCase):
|
|
492
500
|
|
|
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
|