More CLI tests & clearer bytes stuff
Ensuring that bytes are written correctly on all supported Python
versions, including when writing to stdout.
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 @@
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)