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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: protobin
3
- Version: 0.1.0
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')
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "protobin"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  authors = [
9
9
  { name="Daniel Robles", email="drm.electronic@gmail.com" },
10
10
  ]
@@ -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