aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/backends/multibackend.rst
diff options
context:
space:
mode:
authorAdam Goodman <akgood@duosecurity.com>2014-07-23 15:11:46 -0400
committerAdam Goodman <akgood@duosecurity.com>2014-07-23 15:11:46 -0400
commite97ae127f9fc44098f2461a567aa6b9a61e37f5c (patch)
tree671df50035c3daadb26ddb081e36493c610828e5 /docs/hazmat/backends/multibackend.rst
parentab3093ffe7dcc058cbd1b22ecb32b715ca47d6d2 (diff)
parentad116e26d102651ab6dc2752ae21afb92b72ad6f (diff)
downloadcryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.tar.gz
cryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.tar.bz2
cryptography-e97ae127f9fc44098f2461a567aa6b9a61e37f5c.zip
Merge branch 'master' into reorder_libs
Diffstat (limited to 'docs/hazmat/backends/multibackend.rst')
-rw-r--r--docs/hazmat/backends/multibackend.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/hazmat/backends/multibackend.rst b/docs/hazmat/backends/multibackend.rst
index 119b13ae..0aae04a7 100644
--- a/docs/hazmat/backends/multibackend.rst
+++ b/docs/hazmat/backends/multibackend.rst
@@ -12,7 +12,24 @@ MultiBackend
This class allows you to combine multiple backends into a single backend
that offers the combined features of all of its constituents.
- .. code-block:: pycon
+ .. testsetup::
+
+ from cryptography import utils
+ from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
+ from cryptography.hazmat.backends.interfaces import HashBackend
+ from cryptography.hazmat.backends.openssl.backend import backend as backend2
+
+ @utils.register_interface(HashBackend)
+ class DummyHashBackend(object):
+ def hash_supported(self, algorithm):
+ return False
+
+ def create_hash_ctx(self, algorithm):
+ raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_HASH)
+
+ backend1 = DummyHashBackend()
+
+ .. doctest::
>>> from cryptography.hazmat.backends.multibackend import MultiBackend
>>> from cryptography.hazmat.primitives import hashes