diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-28 10:07:55 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-28 10:07:55 -0400 |
commit | a9739749d841818a31ae956fe02e0b3f03a82a31 (patch) | |
tree | 807180ce6c7df203b926d414322c9d0c84b71dff /tests | |
parent | 702d355f9bd2c218a7932e33fe3f587a8f7e3035 (diff) | |
download | python-coveragepy-a9739749d841818a31ae956fe02e0b3f03a82a31.tar.gz |
More abstractions for bytes objects. Cleans up some version checks in the real code.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_backward.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_backward.py b/tests/test_backward.py index 63ee20d..e98017a 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]) |