Skip to content
Commits on Source (2)
# -*- coding: utf-8 -*-
from builtins import bytes
import pytest
from olm import InboundGroupSession, OlmGroupSessionError, OutboundGroupSession
......@@ -121,11 +118,11 @@ class TestClass(object):
outbound = OutboundGroupSession()
inbound = InboundGroupSession(outbound.session_key)
text = outbound.encrypt(bytes([0xed]))
text = outbound.encrypt(b"\xed")
plaintext, _ = inbound.decrypt(text)
print(plaintext)
assert plaintext == ""
assert plaintext == u""
plaintext, _ = inbound.decrypt(text, "ignore")
assert plaintext == ""
# -*- coding: utf-8 -*-
from builtins import bytes
import pytest
from olm import (PkDecryption, PkDecryptionError, PkEncryption, PkSigning,
......@@ -62,6 +60,6 @@ class TestClass(object):
def test_invalid_unicode_decrypt(self):
decryption = PkDecryption()
encryption = PkEncryption(decryption.public_key)
message = encryption.encrypt(bytes([0xed]))
message = encryption.encrypt(b"\xed")
plaintext = decryption.decrypt(message)
assert plaintext == ""
assert plaintext == u""
# -*- coding: utf-8 -*-
from builtins import bytes
import pytest
from olm import (Account, InboundSession, OlmMessage, OlmPreKeyMessage,
......@@ -147,8 +145,8 @@ class TestClass(object):
def test_invalid_unicode_decrypt(self):
alice, bob, session = self._create_session()
message = session.encrypt(bytes([0xed]))
message = session.encrypt(b"\xed")
bob_session = InboundSession(bob, message)
plaintext = bob_session.decrypt(message)
assert plaintext == ""
assert plaintext == u""