aboutsummaryrefslogtreecommitdiffstats
path: root/tests/doubles.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-03-05 14:07:34 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-03-05 14:07:34 -0500
commit77ae0cdf4a04efcd61c936ad85e40f9a26768b23 (patch)
tree1b4b2ea01b8a19f1de621f24c1ca56e58801fae3 /tests/doubles.py
parent59518a0ccc814fd8ef4d1e6fce6e2858a34a7348 (diff)
downloadcryptography-77ae0cdf4a04efcd61c936ad85e40f9a26768b23.tar.gz
cryptography-77ae0cdf4a04efcd61c936ad85e40f9a26768b23.tar.bz2
cryptography-77ae0cdf4a04efcd61c936ad85e40f9a26768b23.zip
turns out you have to _commit_ the file you wrote. who knew!
Diffstat (limited to 'tests/doubles.py')
-rw-r--r--tests/doubles.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/doubles.py b/tests/doubles.py
new file mode 100644
index 00000000..9dbb3ce0
--- /dev/null
+++ b/tests/doubles.py
@@ -0,0 +1,41 @@
+# 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 cryptography import utils
+from cryptography.hazmat.primitives import hashes, serialization
+from cryptography.hazmat.primitives.asymmetric import padding
+from cryptography.hazmat.primitives.ciphers import CipherAlgorithm
+from cryptography.hazmat.primitives.ciphers.modes import Mode
+
+
+@utils.register_interface(CipherAlgorithm)
+class DummyCipherAlgorithm(object):
+ name = "dummy-cipher"
+ block_size = 128
+ key_size = None
+
+
+@utils.register_interface(Mode)
+class DummyMode(object):
+ name = "dummy-mode"
+
+ def validate_for_algorithm(self, algorithm):
+ pass
+
+
+@utils.register_interface(hashes.HashAlgorithm)
+class DummyHashAlgorithm(object):
+ name = "dummy-hash"
+ block_size = None
+ digest_size = None
+
+
+@utils.register_interface(serialization.KeySerializationEncryption)
+class DummyKeySerializationEncryption(object):
+ pass
+
+
+@utils.register_interface(padding.AsymmetricPadding)
+class DummyAsymmetricPadding(object):
+ name = "dummy-padding"