diff options
Diffstat (limited to 'python/tests/session_test.py')
-rw-r--r-- | python/tests/session_test.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/tests/session_test.py b/python/tests/session_test.py index ab1c38b..56a6b83 100644 --- a/python/tests/session_test.py +++ b/python/tests/session_test.py @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +from builtins import bytes + import pytest from olm import (Account, InboundSession, OlmMessage, OlmPreKeyMessage, @@ -141,3 +144,11 @@ class TestClass(object): new_message = new_session.encrypt(plaintext) assert bob_session.matches(new_message) is False + + def test_invalid_unicode_decrypt(self): + alice, bob, session = self._create_session() + message = session.encrypt(bytes([0xed])) + + bob_session = InboundSession(bob, message) + plaintext = bob_session.decrypt(message) + assert plaintext == "�" |