We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 292963d commit 865d721Copy full SHA for 865d721
1 file changed
tests/test_adb_message.py
@@ -8,6 +8,10 @@
8
from adb_shell.adb_message import AdbMessage, checksum, unpack
9
10
11
+def from_int(n):
12
+ return ''.join(chr((n >> (i * 8)) % 256) for i in range(4)).encode('utf-8')
13
+
14
15
class TestAdbMessage(unittest.TestCase):
16
def test_checksum_bytearray(self):
17
cs = checksum(bytearray('TEST', 'utf-8'))
@@ -24,3 +28,7 @@ def test_checksum_unicode(self):
24
28
def test_unpack_error(self):
25
29
with self.assertRaises(ValueError):
26
30
unpack(b'TEST')
31
32
+ def test_constants(self):
33
+ for key, val in constants.ID_TO_WIRE.items():
34
+ self.assertEqual(key, from_int(val))
0 commit comments