diff options
Diffstat (limited to 'tests/conftest.py')
| -rw-r--r-- | tests/conftest.py | 61 |
1 files changed, 55 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index cbf7152..37dd184 100644 --- a/tests/conftest.py +++ b/tests/conftest.py | |||
| @@ -45,9 +45,9 @@ def config_data(): | |||
| 45 | 'ETOOLKIT_SENSITIVE': ['ETOOLKIT_TEST_PASSWORD'], | 45 | 'ETOOLKIT_SENSITIVE': ['ETOOLKIT_TEST_PASSWORD'], |
| 46 | 'GNUPGHOME': '%h/private/.gnupg', | 46 | 'GNUPGHOME': '%h/private/.gnupg', |
| 47 | 'ETOOLKIT_TEST_PASSWORD': ( | 47 | 'ETOOLKIT_TEST_PASSWORD': ( |
| 48 | 'enc-val$2$v6F2M7LeUDbQWNLg6WW5mUcbuYYo7aGynSxzWAENVBI=$' | 48 | 'enc-val$2$RCSZqq9pWrRDoCVYVHopyu1LzaJGfv8roVviqrLTBxM=$' |
| 49 | 'ZcyWzf9Kp0aYI8N+biKMSmu4RGGi199ayq' | 49 | '+YYrZbwTBuG0Pl+WMQrvxLUtq5j8qYuQqz' |
| 50 | 'EYdJl+qdq7b1HSutwYlC7UR2GsSofu4Xo=' | 50 | 'oIwgoGt7AaWZCJz+E7qoDeg3wke70ST8U=' |
| 51 | ), | 51 | ), |
| 52 | }, | 52 | }, |
| 53 | }, | 53 | }, |
| @@ -64,12 +64,35 @@ def config_file(tmp_path, config_data): | |||
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | @pytest.fixture() | 66 | @pytest.fixture() |
| 67 | def long_encrypted_value(): | ||
| 68 | """enc. value corresponding to 'Nobody expects the Spanish inquisition'""" | ||
| 69 | |||
| 70 | return ( | ||
| 71 | 'enc-val$2$uYpZM1VfAGq0CDZL2duITs076CQj+hIFEgx+F4mn80o=$' | ||
| 72 | 'UWP5YeRsh5/2vZ2J1UOS+BJti73Kbp6C1pJmCo8hF' | ||
| 73 | 'Sujpe35X/XpzBegJJpo86AiCsNsUS6B6JM=' | ||
| 74 | ) | ||
| 75 | |||
| 76 | |||
| 77 | @pytest.fixture() | ||
| 78 | def long_value(): | ||
| 79 | """standard value (> 32 bytes)""" | ||
| 80 | return 'Nobody expects the Spanish inquisition' | ||
| 81 | |||
| 82 | |||
| 83 | @pytest.fixture() | ||
| 67 | def master_password(): | 84 | def master_password(): |
| 68 | """Master passord""" | 85 | """Master passord""" |
| 69 | return 'The very secret passwd' | 86 | return 'The very secret passwd' |
| 70 | 87 | ||
| 71 | 88 | ||
| 72 | @pytest.fixture() | 89 | @pytest.fixture() |
| 90 | def new_master_password(): | ||
| 91 | """Master passord""" | ||
| 92 | return 'New very secret passwd' | ||
| 93 | |||
| 94 | |||
| 95 | @pytest.fixture() | ||
| 73 | def non_random_bytes_32(): | 96 | def non_random_bytes_32(): |
| 74 | """always use the same bytes instead of os.urandom(32)""" | 97 | """always use the same bytes instead of os.urandom(32)""" |
| 75 | 98 | ||
| @@ -80,13 +103,13 @@ def non_random_bytes_32(): | |||
| 80 | 103 | ||
| 81 | 104 | ||
| 82 | @pytest.fixture() | 105 | @pytest.fixture() |
| 83 | def non_random_bytes_61(): | 106 | def non_random_bytes_57(): |
| 84 | """always use the same bytes instead of os.urandom(61)""" | 107 | """always use the same bytes instead of os.urandom(57)""" |
| 85 | 108 | ||
| 86 | return ( | 109 | return ( |
| 87 | b'D$\x99\xaa\xafiZ\xb4C\xa0%XTz)\xca\xedK\xcd\xa2F~\xff+\xa1[\xe2\xaa' | 110 | b'D$\x99\xaa\xafiZ\xb4C\xa0%XTz)\xca\xedK\xcd\xa2F~\xff+\xa1[\xe2\xaa' |
| 88 | b'\xb2\xd3\x07\x13\xedb\xc2\x84\xfe\tS\r\xf0\x02_\xef\xe3\xde\xf1?e' | 111 | b'\xb2\xd3\x07\x13\xedb\xc2\x84\xfe\tS\r\xf0\x02_\xef\xe3\xde\xf1?e' |
| 89 | b'\xa4s(Q\x04\xcd\xc7T\x01_D\xb1' | 112 | b'\xa4s(Q\x04\xcd\xc7T' |
| 90 | ) | 113 | ) |
| 91 | 114 | ||
| 92 | 115 | ||
| @@ -108,6 +131,32 @@ def password_hash(): | |||
| 108 | 131 | ||
| 109 | 132 | ||
| 110 | @pytest.fixture() | 133 | @pytest.fixture() |
| 134 | def short_encrypted_value(): | ||
| 135 | """enc. value corresponding to 'secret1'""" | ||
| 136 | |||
| 137 | return ( | ||
| 138 | 'enc-val$2$RCSZqq9pWrRDoCVYVHopyu1LzaJGfv8roVviqrLTBxM=$' | ||
| 139 | '+YYrZbwTBuG0Pl+WMQrvxLUtq5j8qYuQqzoIwgoGt7AaWZCJz+E7qoDeg3wke70ST8U=' | ||
| 140 | ) | ||
| 141 | |||
| 142 | |||
| 143 | @pytest.fixture() | ||
| 144 | def short_encrypted_value_v1(): | ||
| 145 | """enc. value (enc-val 1) corresponding to 'secret1'""" | ||
| 146 | |||
| 147 | return ( | ||
| 148 | 'enc-val$1$/cXpEMoZrTlb9yokGhw8tLTSUkqnqJ4ZoAkurNgMYx' | ||
| 149 | 'w=$1VdkSMcZnLRwLiu1M8VlYcbelwmiVNY=' | ||
| 150 | ) | ||
| 151 | |||
| 152 | |||
| 153 | @pytest.fixture() | ||
| 154 | def short_value(): | ||
| 155 | """standard value (< 32 bytes)""" | ||
| 156 | return 'secret1' | ||
| 157 | |||
| 158 | |||
| 159 | @pytest.fixture() | ||
| 111 | def wrong_master_password(): | 160 | def wrong_master_password(): |
| 112 | """Wrong master passord""" | 161 | """Wrong master passord""" |
| 113 | return 'the very secret passwd' | 162 | return 'the very secret passwd' |
