tests: Simplify the input parameter for the Unicode decoding tests.
This commit is contained in:
parent
28350d612e
commit
61175c969b
3 changed files with 3 additions and 10 deletions
|
@ -1,7 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from olm import InboundGroupSession, OlmGroupSessionError, OutboundGroupSession
|
from olm import InboundGroupSession, OlmGroupSessionError, OutboundGroupSession
|
||||||
|
@ -121,7 +118,7 @@ class TestClass(object):
|
||||||
outbound = OutboundGroupSession()
|
outbound = OutboundGroupSession()
|
||||||
inbound = InboundGroupSession(outbound.session_key)
|
inbound = InboundGroupSession(outbound.session_key)
|
||||||
|
|
||||||
text = outbound.encrypt(bytes([0xed]))
|
text = outbound.encrypt(b"\xed")
|
||||||
plaintext, _ = inbound.decrypt(text)
|
plaintext, _ = inbound.decrypt(text)
|
||||||
|
|
||||||
print(plaintext)
|
print(plaintext)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from olm import (PkDecryption, PkDecryptionError, PkEncryption, PkSigning,
|
from olm import (PkDecryption, PkDecryptionError, PkEncryption, PkSigning,
|
||||||
|
@ -62,6 +60,6 @@ class TestClass(object):
|
||||||
def test_invalid_unicode_decrypt(self):
|
def test_invalid_unicode_decrypt(self):
|
||||||
decryption = PkDecryption()
|
decryption = PkDecryption()
|
||||||
encryption = PkEncryption(decryption.public_key)
|
encryption = PkEncryption(decryption.public_key)
|
||||||
message = encryption.encrypt(bytes([0xed]))
|
message = encryption.encrypt(b"\xed")
|
||||||
plaintext = decryption.decrypt(message)
|
plaintext = decryption.decrypt(message)
|
||||||
assert plaintext == u"<EFBFBD>"
|
assert plaintext == u"<EFBFBD>"
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from olm import (Account, InboundSession, OlmMessage, OlmPreKeyMessage,
|
from olm import (Account, InboundSession, OlmMessage, OlmPreKeyMessage,
|
||||||
|
@ -147,7 +145,7 @@ class TestClass(object):
|
||||||
|
|
||||||
def test_invalid_unicode_decrypt(self):
|
def test_invalid_unicode_decrypt(self):
|
||||||
alice, bob, session = self._create_session()
|
alice, bob, session = self._create_session()
|
||||||
message = session.encrypt(bytes([0xed]))
|
message = session.encrypt(b"\xed")
|
||||||
|
|
||||||
bob_session = InboundSession(bob, message)
|
bob_session = InboundSession(bob, message)
|
||||||
plaintext = bob_session.decrypt(message)
|
plaintext = bob_session.decrypt(message)
|
||||||
|
|
Loading…
Reference in a new issue