summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2023-03-21 19:54:09 +0800
committerGitHub <noreply@github.com>2023-03-21 11:54:09 +0000
commit28c5b8f6f8f1bc8467066bc1139358ec651df67e (patch)
tree317a4443c8bbae4634e35596eefaa9159bb1587d /tests
parent2daf74aabf2404f2249979763ffffab5d73cdf00 (diff)
downloadcryptography-28c5b8f6f8f1bc8467066bc1139358ec651df67e.tar.gz
remove hypothesis from our test suite (#8560)
we weren't really getting any value from it and we haven't expanded our use in numerous years
Diffstat (limited to 'tests')
-rw-r--r--tests/hypothesis/__init__.py3
-rw-r--r--tests/hypothesis/test_fernet.py16
-rw-r--r--tests/hypothesis/test_padding.py34
-rw-r--r--tests/hypothesis/test_x509.py22
4 files changed, 0 insertions, 75 deletions
diff --git a/tests/hypothesis/__init__.py b/tests/hypothesis/__init__.py
deleted file mode 100644
index b50933623..000000000
--- a/tests/hypothesis/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
diff --git a/tests/hypothesis/test_fernet.py b/tests/hypothesis/test_fernet.py
deleted file mode 100644
index 75195f530..000000000
--- a/tests/hypothesis/test_fernet.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from hypothesis import HealthCheck, given, settings
-from hypothesis.strategies import binary
-
-from cryptography.fernet import Fernet
-
-
-@settings(suppress_health_check=[HealthCheck.too_slow], deadline=None)
-@given(binary())
-def test_fernet(data):
- f = Fernet(Fernet.generate_key())
- ct = f.encrypt(data)
- assert f.decrypt(ct) == data
diff --git a/tests/hypothesis/test_padding.py b/tests/hypothesis/test_padding.py
deleted file mode 100644
index 74a58eb8c..000000000
--- a/tests/hypothesis/test_padding.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from hypothesis import HealthCheck, given, settings
-from hypothesis.strategies import binary, integers
-
-from cryptography.hazmat.primitives.padding import ANSIX923, PKCS7
-
-
-@settings(suppress_health_check=[HealthCheck.too_slow], deadline=None)
-@given(integers(min_value=1, max_value=255), binary())
-def test_pkcs7(block_size, data):
- # Generate in [1, 31] so we can easily get block_size in bits by
- # multiplying by 8.
- p = PKCS7(block_size=block_size * 8)
- padder = p.padder()
- unpadder = p.unpadder()
-
- padded = padder.update(data) + padder.finalize()
-
- assert unpadder.update(padded) + unpadder.finalize() == data
-
-
-@settings(suppress_health_check=[HealthCheck.too_slow])
-@given(integers(min_value=1, max_value=255), binary())
-def test_ansix923(block_size, data):
- a = ANSIX923(block_size=block_size * 8)
- padder = a.padder()
- unpadder = a.unpadder()
-
- padded = padder.update(data) + padder.finalize()
-
- assert unpadder.update(padded) + unpadder.finalize() == data
diff --git a/tests/hypothesis/test_x509.py b/tests/hypothesis/test_x509.py
deleted file mode 100644
index 02d672597..000000000
--- a/tests/hypothesis/test_x509.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from hypothesis import HealthCheck, example, given, settings
-from hypothesis.strategies import text
-
-from cryptography import x509
-
-
-@settings(suppress_health_check=[HealthCheck.too_slow], deadline=None)
-@given(text())
-@example("CN=cryptography.io")
-def test_name_from_rfc4514(data):
- try:
- x509.Name.from_rfc4514_string(data)
- except ValueError:
- return
-
- # Can't assert that it round-trips because of things like "OID=value"
- # where OID is one of the known OIDs that serializes to a known value
- # (e.g. CN)