tests: Use Unicode literals in the Unicode decoding tests.

This is needed because the function returns Unicode strings and the
comparison will fail under python2 unless Unicode literals are used.
This commit is contained in:
Damir Jelić 2019-06-20 13:38:35 +02:00
parent c4d703ac3d
commit 28350d612e
3 changed files with 3 additions and 3 deletions

View file

@ -125,7 +125,7 @@ class TestClass(object):
plaintext, _ = inbound.decrypt(text) plaintext, _ = inbound.decrypt(text)
print(plaintext) print(plaintext)
assert plaintext == "<EFBFBD>" assert plaintext == u"<EFBFBD>"
plaintext, _ = inbound.decrypt(text, "ignore") plaintext, _ = inbound.decrypt(text, "ignore")
assert plaintext == "" assert plaintext == ""

View file

@ -64,4 +64,4 @@ class TestClass(object):
encryption = PkEncryption(decryption.public_key) encryption = PkEncryption(decryption.public_key)
message = encryption.encrypt(bytes([0xed])) message = encryption.encrypt(bytes([0xed]))
plaintext = decryption.decrypt(message) plaintext = decryption.decrypt(message)
assert plaintext == "<EFBFBD>" assert plaintext == u"<EFBFBD>"

View file

@ -151,4 +151,4 @@ class TestClass(object):
bob_session = InboundSession(bob, message) bob_session = InboundSession(bob, message)
plaintext = bob_session.decrypt(message) plaintext = bob_session.decrypt(message)
assert plaintext == "<EFBFBD>" assert plaintext == u"<EFBFBD>"