aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-06-13 10:33:32 -0700
committerDavid Reid <dreid@dreid.org>2014-06-13 10:33:32 -0700
commit3ad768f7af9aa5cecbfec210f7fde5578672a5a3 (patch)
treebb90e7d32b5f031037097a34e9a0c26724ae5b97 /tests/hazmat/backends
parent07de62c1ecf9c202a45a5c49b280c1df4eb3f685 (diff)
downloadcryptography-3ad768f7af9aa5cecbfec210f7fde5578672a5a3.tar.gz
cryptography-3ad768f7af9aa5cecbfec210f7fde5578672a5a3.tar.bz2
cryptography-3ad768f7af9aa5cecbfec210f7fde5578672a5a3.zip
Fix flake8.
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_openssl.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 09a7f0a5..420baf6b 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -13,8 +13,8 @@
from __future__ import absolute_import, division, print_function
-import sys
import subprocess
+import sys
import textwrap
import pretend
@@ -219,22 +219,21 @@ class TestOpenSSLRandomEngine(object):
# This must be the first test in the class so that the teardown method
# has not (potentially) altered the default engine.
def test_osrandom_engine_is_default(self):
+ engine_printer = textwrap.dedent(
+ """
+ import sys
+ from cryptography.hazmat.backends.openssl.backend import backend
+
+ e = backend._lib.ENGINE_get_default_RAND()
+ name = backend._lib.ENGINE_get_name(e)
+ sys.stdout.write(backend._ffi.string(name))
+ res = backend._lib.ENGINE_free(e)
+ assert res == 1
+ """
+ )
+
engine_name = subprocess.check_output(
- [sys.executable,
- "-c",
- textwrap.dedent(
- """
- import sys
- from cryptography.hazmat.backends.openssl.backend import backend
-
- e = backend._lib.ENGINE_get_default_RAND()
- name = backend._lib.ENGINE_get_name(e)
- sys.stdout.write(backend._ffi.string(name))
- res = backend._lib.ENGINE_free(e)
- assert res == 1
- """
- )
- ]
+ [sys.executable, "-c", engine_printer]
)
osrandom_engine_name = backend._ffi.string(