Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
61175c96
Commit
61175c96
authored
Jun 20, 2019
by
poljar
Browse files
tests: Simplify the input parameter for the Unicode decoding tests.
parent
28350d61
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/tests/group_session_test.py
View file @
61175c96
# -*- coding: utf-8 -*-
from
builtins
import
bytes
import
pytest
from
olm
import
InboundGroupSession
,
OlmGroupSessionError
,
OutboundGroupSession
...
...
@@ -121,7 +118,7 @@ class TestClass(object):
outbound
=
OutboundGroupSession
()
inbound
=
InboundGroupSession
(
outbound
.
session_key
)
text
=
outbound
.
encrypt
(
b
ytes
([
0
xed
])
)
text
=
outbound
.
encrypt
(
b
"
\
xed
"
)
plaintext
,
_
=
inbound
.
decrypt
(
text
)
print
(
plaintext
)
...
...
python/tests/pk_test.py
View file @
61175c96
# -*- 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
(
b
ytes
([
0
xed
])
)
message
=
encryption
.
encrypt
(
b
"
\
xed
"
)
plaintext
=
decryption
.
decrypt
(
message
)
assert
plaintext
==
u
"�"
python/tests/session_test.py
View file @
61175c96
# -*- coding: utf-8 -*-
from
builtins
import
bytes
import
pytest
from
olm
import
(
Account
,
InboundSession
,
OlmMessage
,
OlmPreKeyMessage
,
...
...
@@ -147,7 +145,7 @@ class TestClass(object):
def
test_invalid_unicode_decrypt
(
self
):
alice
,
bob
,
session
=
self
.
_create_session
()
message
=
session
.
encrypt
(
b
ytes
([
0
xed
])
)
message
=
session
.
encrypt
(
b
"
\
xed
"
)
bob_session
=
InboundSession
(
bob
,
message
)
plaintext
=
bob_session
.
decrypt
(
message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment