Encoding changes in tests for py3
In many cases we do need to be explicit about bytes vs. strings for
python 3 compatibility.
Change-Id: I9cbc5c73004d03f711f8a6e5752a0865ae55fb9f
diff --git a/tests/unit/test_encryption.py b/tests/unit/test_encryption.py
index 4dda78b..b424769 100644
--- a/tests/unit/test_encryption.py
+++ b/tests/unit/test_encryption.py
@@ -41,14 +41,14 @@
def test_pkcs1_oaep(self):
"Verify encryption and decryption"
- orig_plaintext = "some text to encrypt"
+ orig_plaintext = b"some text to encrypt"
ciphertext = encryption.encrypt_pkcs1_oaep(orig_plaintext, self.public)
plaintext = encryption.decrypt_pkcs1_oaep(ciphertext, self.private)
self.assertEqual(orig_plaintext, plaintext)
def test_openssl_pkcs1_oaep(self):
"Verify that we can decrypt something encrypted with OpenSSL"
- orig_plaintext = "some text to encrypt"
+ orig_plaintext = b"some text to encrypt"
pem_public = encryption.serialize_rsa_public_key(self.public)
public_file = tempfile.NamedTemporaryFile(delete=False)
try: