diff options
Diffstat (limited to 'tests/conftest.py')
| -rw-r--r-- | tests/conftest.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index a4463fd..6cc8b9f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # etoolkit | 1 | # etoolkit |
| 2 | # Copyright (C) 2021-2024 Simeon Simeonov | 2 | # Copyright (C) 2021-2026 Simeon Simeonov |
| 3 | 3 | ||
| 4 | # This program is free software: you can redistribute it and/or modify | 4 | # This program is free software: you can redistribute it and/or modify |
| 5 | # it under the terms of the GNU General Public License as published by | 5 | # it under the terms of the GNU General Public License as published by |
| @@ -20,7 +20,7 @@ import json | |||
| 20 | import pytest | 20 | import pytest |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | @pytest.fixture() | 23 | @pytest.fixture |
| 24 | def config_data(): | 24 | def config_data(): |
| 25 | """config_data for testing""" | 25 | """config_data for testing""" |
| 26 | 26 | ||
| @@ -59,7 +59,7 @@ def config_data(): | |||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | @pytest.fixture() | 62 | @pytest.fixture |
| 63 | def config_file(tmp_path, config_data): | 63 | def config_file(tmp_path, config_data): |
| 64 | """Temporary config file for testing that includes config_data""" | 64 | """Temporary config file for testing that includes config_data""" |
| 65 | 65 | ||
| @@ -68,7 +68,7 @@ def config_file(tmp_path, config_data): | |||
| 68 | return str(cf) | 68 | return str(cf) |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | @pytest.fixture() | 71 | @pytest.fixture |
| 72 | def long_encrypted_value(): | 72 | def long_encrypted_value(): |
| 73 | """enc. value corresponding to 'Nobody expects the Spanish inquisition'""" | 73 | """enc. value corresponding to 'Nobody expects the Spanish inquisition'""" |
| 74 | 74 | ||
| @@ -79,25 +79,25 @@ def long_encrypted_value(): | |||
| 79 | ) | 79 | ) |
| 80 | 80 | ||
| 81 | 81 | ||
| 82 | @pytest.fixture() | 82 | @pytest.fixture |
| 83 | def long_value(): | 83 | def long_value(): |
| 84 | """standard value (> 32 bytes)""" | 84 | """standard value (> 32 bytes)""" |
| 85 | return 'Nobody expects the Spanish inquisition' | 85 | return 'Nobody expects the Spanish inquisition' |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | @pytest.fixture() | 88 | @pytest.fixture |
| 89 | def master_password(): | 89 | def master_password(): |
| 90 | """Master passord""" | 90 | """Master passord""" |
| 91 | return 'The very secret passwd' | 91 | return 'The very secret passwd' |
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | @pytest.fixture() | 94 | @pytest.fixture |
| 95 | def new_master_password(): | 95 | def new_master_password(): |
| 96 | """Master passord""" | 96 | """Master passord""" |
| 97 | return 'New very secret passwd' | 97 | return 'New very secret passwd' |
| 98 | 98 | ||
| 99 | 99 | ||
| 100 | @pytest.fixture() | 100 | @pytest.fixture |
| 101 | def non_random_bytes_32(): | 101 | def non_random_bytes_32(): |
| 102 | """always use the same bytes instead of os.urandom(32)""" | 102 | """always use the same bytes instead of os.urandom(32)""" |
| 103 | 103 | ||
| @@ -107,7 +107,7 @@ def non_random_bytes_32(): | |||
| 107 | ) | 107 | ) |
| 108 | 108 | ||
| 109 | 109 | ||
| 110 | @pytest.fixture() | 110 | @pytest.fixture |
| 111 | def non_random_bytes_57(): | 111 | def non_random_bytes_57(): |
| 112 | """always use the same bytes instead of os.urandom(57)""" | 112 | """always use the same bytes instead of os.urandom(57)""" |
| 113 | 113 | ||
| @@ -118,14 +118,14 @@ def non_random_bytes_57(): | |||
| 118 | ) | 118 | ) |
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | @pytest.fixture() | 121 | @pytest.fixture |
| 122 | def nonexistent_config_file(tmp_path): | 122 | def nonexistent_config_file(tmp_path): |
| 123 | """temporary config file for testing that includes config_data""" | 123 | """temporary config file for testing that includes config_data""" |
| 124 | 124 | ||
| 125 | return str(tmp_path / 'etoolkitt.json') | 125 | return str(tmp_path / 'etoolkitt.json') |
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | @pytest.fixture() | 128 | @pytest.fixture |
| 129 | def password_hash(): | 129 | def password_hash(): |
| 130 | """password hash for testing, corresponding to 'The very secret passwd'""" | 130 | """password hash for testing, corresponding to 'The very secret passwd'""" |
| 131 | 131 | ||
| @@ -135,7 +135,7 @@ def password_hash(): | |||
| 135 | ) | 135 | ) |
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | @pytest.fixture() | 138 | @pytest.fixture |
| 139 | def short_encrypted_value(): | 139 | def short_encrypted_value(): |
| 140 | """enc. value corresponding to 'secret1'""" | 140 | """enc. value corresponding to 'secret1'""" |
| 141 | 141 | ||
| @@ -145,7 +145,7 @@ def short_encrypted_value(): | |||
| 145 | ) | 145 | ) |
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | @pytest.fixture() | 148 | @pytest.fixture |
| 149 | def short_encrypted_value_v1(): | 149 | def short_encrypted_value_v1(): |
| 150 | """enc. value (enc-val 1) corresponding to 'secret1'""" | 150 | """enc. value (enc-val 1) corresponding to 'secret1'""" |
| 151 | 151 | ||
| @@ -155,13 +155,13 @@ def short_encrypted_value_v1(): | |||
| 155 | ) | 155 | ) |
| 156 | 156 | ||
| 157 | 157 | ||
| 158 | @pytest.fixture() | 158 | @pytest.fixture |
| 159 | def short_value(): | 159 | def short_value(): |
| 160 | """standard value (< 32 bytes)""" | 160 | """standard value (< 32 bytes)""" |
| 161 | return 'secret1' | 161 | return 'secret1' |
| 162 | 162 | ||
| 163 | 163 | ||
| 164 | @pytest.fixture() | 164 | @pytest.fixture |
| 165 | def wrong_master_password(): | 165 | def wrong_master_password(): |
| 166 | """Wrong master passord""" | 166 | """Wrong master passord""" |
| 167 | return 'the very secret passwd' | 167 | return 'the very secret passwd' |
