aboutsummaryrefslogtreecommitdiff
path: root/python/tests/group_session_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/group_session_test.py')
-rw-r--r--python/tests/group_session_test.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/tests/group_session_test.py b/python/tests/group_session_test.py
index c17e84f..3942024 100644
--- a/python/tests/group_session_test.py
+++ b/python/tests/group_session_test.py
@@ -1,3 +1,7 @@
+# -*- coding: utf-8 -*-
+
+from builtins import bytes
+
import pytest
from olm import InboundGroupSession, OlmGroupSessionError, OutboundGroupSession
@@ -112,3 +116,16 @@ class TestClass(object):
outbound = OutboundGroupSession()
inbound = InboundGroupSession(outbound.session_key)
del inbound
+
+ def test_invalid_unicode_decrypt(self):
+ outbound = OutboundGroupSession()
+ inbound = InboundGroupSession(outbound.session_key)
+
+ text = outbound.encrypt(bytes([0xed]))
+ plaintext, _ = inbound.decrypt(text)
+
+ print(plaintext)
+ assert plaintext == "�"
+
+ plaintext, _ = inbound.decrypt(text, "ignore")
+ assert plaintext == ""