diff --git a/tests/softhsm_setup.py b/tests/softhsm_setup.py index 311ab50c..90e06b6d 100644 --- a/tests/softhsm_setup.py +++ b/tests/softhsm_setup.py @@ -33,9 +33,7 @@ def run_cmd(args, softhsm_conf=None) -> Tuple[bytes, bytes]: if softhsm_conf is not None: env['SOFTHSM_CONF'] = softhsm_conf env['SOFTHSM2_CONF'] = softhsm_conf - proc = subprocess.Popen( - args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env - ) + proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) out, err = proc.communicate() if err is not None and len(err) > 0: logging.error(err) @@ -88,9 +86,7 @@ def run_cmd(args, softhsm_conf=None) -> Tuple[bytes, bytes]: } component_path: Dict[str, str] = { - component_name: find_alts( - component_name, paths_for_component(component_name, default_paths) - ) + component_name: find_alts(component_name, paths_for_component(component_name, default_paths)) for component_name, default_paths in component_default_paths.items() } @@ -98,9 +94,7 @@ def run_cmd(args, softhsm_conf=None) -> Tuple[bytes, bytes]: if component_path['SOFTHSM'].endswith('softhsm2-util'): softhsm_version = 2 -openssl_version = subprocess.check_output([component_path['OPENSSL'], 'version'])[ - 8:11 -].decode() +openssl_version = subprocess.check_output([component_path['OPENSSL'], 'version'])[8:11].decode() p11_test_files: List[str] = [] softhsm_conf: Optional[str] = None @@ -119,9 +113,7 @@ def _temp_dir() -> str: return d -@unittest.skipIf( - component_path['P11_MODULE'] is None, 'SoftHSM PKCS11 module not installed' -) +@unittest.skipIf(component_path['P11_MODULE'] is None, 'SoftHSM PKCS11 module not installed') def setup() -> None: logging.debug('Creating test pkcs11 token using softhsm') try: @@ -228,9 +220,7 @@ def setup() -> None: ) signer_cert_pem = _temp_file() openssl_conf = _temp_file() - logging.debug( - 'Generating OpenSSL config for version {}'.format(openssl_version) - ) + logging.debug('Generating OpenSSL config for version {}'.format(openssl_version)) with open(openssl_conf, 'w') as f: # Might be needed with some versions of openssl, but in more recent versions dynamic_path breaks it. # dynamic_path = (