diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-13 17:58:56 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-13 17:58:56 +0200 |
| commit | 394e306633a7e8898b8d6d1bee5bd247de6ae705 (patch) | |
| tree | 962a0eb5af3d88d99bd9816e0e9d7de00f0aec9b /test/toolkit.py | |
| parent | use nested namespaces (diff) | |
| download | aes-tools-394e306633a7e8898b8d6d1bee5bd247de6ae705.tar.gz aes-tools-394e306633a7e8898b8d6d1bee5bd247de6ae705.zip | |
workflows/ci: add linting for Python test scripts
Diffstat (limited to 'test/toolkit.py')
| -rw-r--r-- | test/toolkit.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/test/toolkit.py b/test/toolkit.py index 650e81e..deafd8f 100644 --- a/test/toolkit.py +++ b/test/toolkit.py @@ -88,7 +88,8 @@ class Tools: logging.debug('Trying to execute: %s', subprocess.list2cmdline(cmd_list)) try: output = subprocess.check_output( - cmd_list, universal_newlines=True, stderr=subprocess.STDOUT) + cmd_list, universal_newlines=True, stderr=subprocess.STDOUT + ) except subprocess.CalledProcessError as e: logging.error('Output:\n%s', e.output) raise @@ -109,8 +110,10 @@ class Tools: @staticmethod def _block_settings_to_args(algorithm, mode, use_boxes=False): args = [ - '--algorithm', str(algorithm), - '--mode', str(mode), + '--algorithm', + str(algorithm), + '--mode', + str(mode), ] if use_boxes: args.append('--use-boxes') @@ -134,30 +137,30 @@ class Tools: return self.run(self._DECRYPT_BLOCK, args) @staticmethod - def _build_file_args( - algorithm, mode, key, input_path, output_path, iv=None): + def _build_file_args(algorithm, mode, key, input_path, output_path, iv=None): args = [ - '--algorithm', str(algorithm), - '--mode', str(mode), - '--key', key, - '--input', input_path, - '--output', output_path + '--algorithm', + str(algorithm), + '--mode', + str(mode), + '--key', + key, + '--input', + input_path, + '--output', + output_path, ] if iv is not None: args.extend(('--iv', iv)) return args - def run_encrypt_file( - self, algorithm, mode, key, input_path, output_path, iv=None): + def run_encrypt_file(self, algorithm, mode, key, input_path, output_path, iv=None): - args = self._build_file_args( - algorithm, mode, key, input_path, output_path, iv) + args = self._build_file_args(algorithm, mode, key, input_path, output_path, iv) return self.run(self._ENCRYPT_FILE, args) - def run_decrypt_file( - self, algorithm, mode, key, input_path, output_path, iv=None): + def run_decrypt_file(self, algorithm, mode, key, input_path, output_path, iv=None): - args = self._build_file_args( - algorithm, mode, key, input_path, output_path, iv) + args = self._build_file_args(algorithm, mode, key, input_path, output_path, iv) return self.run(self._DECRYPT_FILE, args) |
