Marco Ricci
Reintegrate all functionality as subcommands
Marco Ricci commited 61f4c67 at 2024-09-11 12:20:16
test_derivepassphrase_exporter.py
# SPDX-FileCopyrightText: 2024 Marco Ricci <software@the13thletter.info>
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
import os
import click.testing
import pytest
import tests
from derivepassphrase import cli, exporter
class Test001ExporterUtils:
@pytest.mark.parametrize(
['expected', 'vault_key', 'logname', 'user', 'username'],
[
('4username', None, None, None, '4username'),
('3user', None, None, '3user', None),
('3user', None, None, '3user', '4username'),
('2logname', None, '2logname', None, None),
('2logname', None, '2logname', None, '4username'),
('2logname', None, '2logname', '3user', None),
('2logname', None, '2logname', '3user', '4username'),
('1vault_key', '1vault_key', None, None, None),
('1vault_key', '1vault_key', None, None, '4username'),
('1vault_key', '1vault_key', None, '3user', None),
('1vault_key', '1vault_key', None, '3user', '4username'),
('1vault_key', '1vault_key', '2logname', None, None),
('1vault_key', '1vault_key', '2logname', None, '4username'),
('1vault_key', '1vault_key', '2logname', '3user', None),
('1vault_key', '1vault_key', '2logname', '3user', '4username'),
],
)
def test200_get_vault_key(
self,
monkeypatch: pytest.MonkeyPatch,
expected: str,
vault_key: str | None,
logname: str | None,
user: str | None,
username: str | None,
) -> None:
priority_list = [
('VAULT_KEY', vault_key),
('LOGNAME', logname),
('USER', user),
('USERNAME', username),
]
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX