diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-03-17 15:52:23 +0100 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-03-17 15:52:23 +0100 |
commit | f0627bed3e8815e8138fbe72b740483f69d6ac7a (patch) | |
tree | b3c76a0cc0efe1a08ee50683a647292fe91ba90d /tests/test_compat.py | |
parent | 3d5c098dbcd1f7732b7b559f793f4b0944e90884 (diff) | |
download | rsa-f0627bed3e8815e8138fbe72b740483f69d6ac7a.tar.gz |
More CLI tests & clearer bytes stuff
Ensuring that bytes are written correctly on all supported Python
versions, including when writing to stdout.
Diffstat (limited to 'tests/test_compat.py')
-rw-r--r-- | tests/test_compat.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_compat.py b/tests/test_compat.py index 8cbf101..74d6f53 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -16,8 +16,9 @@ import unittest import struct +import sys -from rsa._compat import is_bytes, byte +from rsa._compat import is_bytes, byte, b class TestByte(unittest.TestCase): @@ -30,3 +31,6 @@ class TestByte(unittest.TestCase): def test_raises_StructError_on_overflow(self): self.assertRaises(struct.error, byte, 256) self.assertRaises(struct.error, byte, -1) + + def test_byte_literal(self): + self.assertIsInstance(b('abc'), bytes) |