summaryrefslogtreecommitdiff
path: root/tests/test_backward.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_backward.py')
-rw-r--r--tests/test_backward.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_backward.py b/tests/test_backward.py
index 63ee20d0..e98017ae 100644
--- a/tests/test_backward.py
+++ b/tests/test_backward.py
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
"""Tests that our version shims in backward.py are working."""
-from coverage.backward import iitems
+from coverage.backward import iitems, binary_bytes, byte_to_int, bytes_to_ints
from tests.backunittest import TestCase
@@ -14,3 +13,10 @@ class BackwardTest(TestCase):
d = {'a': 1, 'b': 2, 'c': 3}
items = [('a', 1), ('b', 2), ('c', 3)]
self.assertSameElements(list(iitems(d)), items)
+
+ def test_binary_bytes(self):
+ byte_values = [0, 255, 17, 23, 42, 57]
+ bb = binary_bytes(byte_values)
+ self.assertEqual(len(bb), len(byte_values))
+ self.assertEqual(byte_values, list(bytes_to_ints(bb)))
+ self.assertEqual(byte_values, [byte_to_int(b) for b in bb])