Loading python/test-requirements.txt +0 −1 Original line number Diff line number Diff line pytest hypothesis pytest-flake8 pytest-isort pytest-cov Loading python/tests/account_test.py +6 −8 Original line number Diff line number Diff line from builtins import int import pytest from hypothesis import given from hypothesis.strategies import text from olm import Account, OlmAccountError, OlmVerifyError, ed25519_verify from olm._compat import to_bytes Loading Loading @@ -73,8 +71,8 @@ class TestClass(object): alice = Account() del alice @given(text()) def test_valid_signature(self, message): def test_valid_signature(self): message = "It's a secret to everybody" alice = Account() signature = alice.sign(message) Loading @@ -85,8 +83,8 @@ class TestClass(object): ed25519_verify(signing_key, message, signature) @given(text()) def test_invalid_signature(self, message): def test_invalid_signature(self): message = "It's a secret to everybody" alice = Account() bob = Account() Loading @@ -99,8 +97,8 @@ class TestClass(object): with pytest.raises(OlmVerifyError): ed25519_verify(signing_key, message, signature) @given(text()) def test_signature_verification_twice(self, message): def test_signature_verification_twice(self): message = "It's a secret to everybody" alice = Account() signature = alice.sign(message) Loading python/tests/utils_test.py +5 −9 Original line number Diff line number Diff line Loading @@ -2,16 +2,16 @@ import base64 import hashlib from future.utils import bytes_to_native_str from hypothesis import given from hypothesis.strategies import text from olm import sha256 from olm._compat import to_bytes class TestClass(object): @given(text(), text()) def test_sha256(self, input1, input2): def test_sha256(self): input1 = "It's a secret to everybody" input2 = "It's a secret to nobody" first_hash = sha256(input1) second_hash = sha256(input2) Loading @@ -21,9 +21,5 @@ class TestClass(object): hashlib_hash = bytes_to_native_str(hashlib_hash[:-1]) if input1 == input2: assert first_hash == second_hash else: assert first_hash != second_hash assert hashlib_hash == first_hash Loading
python/test-requirements.txt +0 −1 Original line number Diff line number Diff line pytest hypothesis pytest-flake8 pytest-isort pytest-cov Loading
python/tests/account_test.py +6 −8 Original line number Diff line number Diff line from builtins import int import pytest from hypothesis import given from hypothesis.strategies import text from olm import Account, OlmAccountError, OlmVerifyError, ed25519_verify from olm._compat import to_bytes Loading Loading @@ -73,8 +71,8 @@ class TestClass(object): alice = Account() del alice @given(text()) def test_valid_signature(self, message): def test_valid_signature(self): message = "It's a secret to everybody" alice = Account() signature = alice.sign(message) Loading @@ -85,8 +83,8 @@ class TestClass(object): ed25519_verify(signing_key, message, signature) @given(text()) def test_invalid_signature(self, message): def test_invalid_signature(self): message = "It's a secret to everybody" alice = Account() bob = Account() Loading @@ -99,8 +97,8 @@ class TestClass(object): with pytest.raises(OlmVerifyError): ed25519_verify(signing_key, message, signature) @given(text()) def test_signature_verification_twice(self, message): def test_signature_verification_twice(self): message = "It's a secret to everybody" alice = Account() signature = alice.sign(message) Loading
python/tests/utils_test.py +5 −9 Original line number Diff line number Diff line Loading @@ -2,16 +2,16 @@ import base64 import hashlib from future.utils import bytes_to_native_str from hypothesis import given from hypothesis.strategies import text from olm import sha256 from olm._compat import to_bytes class TestClass(object): @given(text(), text()) def test_sha256(self, input1, input2): def test_sha256(self): input1 = "It's a secret to everybody" input2 = "It's a secret to nobody" first_hash = sha256(input1) second_hash = sha256(input2) Loading @@ -21,9 +21,5 @@ class TestClass(object): hashlib_hash = bytes_to_native_str(hashlib_hash[:-1]) if input1 == input2: assert first_hash == second_hash else: assert first_hash != second_hash assert hashlib_hash == first_hash