Marco Ricci commited on 2024-09-01 15:01:07
Zeige 3 geänderte Dateien mit 9 Einfügungen und 9 Löschungen.
| ... | ... |
@@ -41,7 +41,7 @@ def _load_data( |
| 41 | 41 |
match fmt: |
| 42 | 42 |
case 'v0.2': |
| 43 | 43 |
module = importlib.import_module( |
| 44 |
- 'derivepassphrase.exporter.vault_v03_and_below' |
|
| 44 |
+ 'derivepassphrase.exporter.vault_native' |
|
| 45 | 45 |
) |
| 46 | 46 |
if module.STUBBED: |
| 47 | 47 |
raise ModuleNotFoundError |
| ... | ... |
@@ -50,7 +50,7 @@ def _load_data( |
| 50 | 50 |
return module.VaultNativeV02ConfigParser(contents, key)() |
| 51 | 51 |
case 'v0.3': |
| 52 | 52 |
module = importlib.import_module( |
| 53 |
- 'derivepassphrase.exporter.vault_v03_and_below' |
|
| 53 |
+ 'derivepassphrase.exporter.vault_native' |
|
| 54 | 54 |
) |
| 55 | 55 |
if module.STUBBED: |
| 56 | 56 |
raise ModuleNotFoundError |
| ... | ... |
@@ -12,7 +12,7 @@ import click.testing |
| 12 | 12 |
import pytest |
| 13 | 13 |
|
| 14 | 14 |
import tests |
| 15 |
-from derivepassphrase.exporter import cli, storeroom, vault_v03_and_below |
|
| 15 |
+from derivepassphrase.exporter import cli, storeroom, vault_native |
|
| 16 | 16 |
|
| 17 | 17 |
cryptography = pytest.importorskip('cryptography', minversion='38.0')
|
| 18 | 18 |
|
| ... | ... |
@@ -317,7 +317,7 @@ class TestVaultNativeConfig: |
| 317 | 317 |
) |
| 318 | 318 |
def test_200_pbkdf2_manually(self, iterations: int, result: bytes) -> None: |
| 319 | 319 |
assert ( |
| 320 |
- vault_v03_and_below.VaultNativeConfigParser._pbkdf2( |
|
| 320 |
+ vault_native.VaultNativeConfigParser._pbkdf2( |
|
| 321 | 321 |
tests.VAULT_MASTER_KEY.encode('utf-8'), 32, iterations
|
| 322 | 322 |
) |
| 323 | 323 |
== result |
| ... | ... |
@@ -327,13 +327,13 @@ class TestVaultNativeConfig: |
| 327 | 327 |
['parser_class', 'config', 'result'], |
| 328 | 328 |
[ |
| 329 | 329 |
pytest.param( |
| 330 |
- vault_v03_and_below.VaultNativeV02ConfigParser, |
|
| 330 |
+ vault_native.VaultNativeV02ConfigParser, |
|
| 331 | 331 |
tests.VAULT_V02_CONFIG, |
| 332 | 332 |
tests.VAULT_V02_CONFIG_DATA, |
| 333 | 333 |
id='0.2', |
| 334 | 334 |
), |
| 335 | 335 |
pytest.param( |
| 336 |
- vault_v03_and_below.VaultNativeV03ConfigParser, |
|
| 336 |
+ vault_native.VaultNativeV03ConfigParser, |
|
| 337 | 337 |
tests.VAULT_V03_CONFIG, |
| 338 | 338 |
tests.VAULT_V03_CONFIG_DATA, |
| 339 | 339 |
id='0.3', |
| ... | ... |
@@ -343,7 +343,7 @@ class TestVaultNativeConfig: |
| 343 | 343 |
def test_300_result_caching( |
| 344 | 344 |
self, |
| 345 | 345 |
monkeypatch: pytest.MonkeyPatch, |
| 346 |
- parser_class: type[vault_v03_and_below.VaultNativeConfigParser], |
|
| 346 |
+ parser_class: type[vault_native.VaultNativeConfigParser], |
|
| 347 | 347 |
config: str, |
| 348 | 348 |
result: dict[str, Any], |
| 349 | 349 |
) -> None: |
| ... | ... |
@@ -378,9 +378,9 @@ class TestVaultNativeConfig: |
| 378 | 378 |
parser, '_decrypt_payload', null_func('_decrypt_payload')
|
| 379 | 379 |
) |
| 380 | 380 |
assert parser() == result |
| 381 |
- super_call = vault_v03_and_below.VaultNativeConfigParser.__call__ |
|
| 381 |
+ super_call = vault_native.VaultNativeConfigParser.__call__ |
|
| 382 | 382 |
assert super_call(parser) == result |
| 383 | 383 |
|
| 384 | 384 |
def test_400_no_password(self) -> None: |
| 385 | 385 |
with pytest.raises(ValueError, match='Password must not be empty'): |
| 386 |
- vault_v03_and_below.VaultNativeV03ConfigParser(b'', b'') |
|
| 386 |
+ vault_native.VaultNativeV03ConfigParser(b'', b'') |
|
| 387 | 387 |