chore: improve archinstall maintenance path
This commit is contained in:
parent
f9534c67cd
commit
cd48e4d36b
|
|
@ -5,49 +5,69 @@ import pytest
|
|||
|
||||
@pytest.fixture(scope='session')
|
||||
def config_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_config.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_config.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def btrfs_config_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_config_btrfs.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_config_btrfs.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def creds_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_creds.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_creds.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def encrypted_creds_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_encrypted_creds.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_encrypted_creds.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def deprecated_creds_config() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_deprecated_creds_config.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_deprecated_creds_config.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def deprecated_mirror_config() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_deprecated_mirror_config.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_deprecated_mirror_config.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def deprecated_audio_config() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'test_deprecated_audio_config.json'
|
||||
path = Path(__file__).parent / 'data' / 'test_deprecated_audio_config.json'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def mirrorlist_no_country_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'mirrorlists' / 'test_no_country'
|
||||
path = Path(__file__).parent / 'data' / 'mirrorlists' / 'test_no_country'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def mirrorlist_with_country_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'mirrorlists' / 'test_with_country'
|
||||
path = Path(__file__).parent / 'data' / 'mirrorlists' / 'test_with_country'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def mirrorlist_multiple_countries_fixture() -> Path:
|
||||
return Path(__file__).parent / 'data' / 'mirrorlists' / 'test_multiple_countries'
|
||||
path = Path(__file__).parent / 'data' / 'mirrorlists' / 'test_multiple_countries'
|
||||
assert path.exists(), f'Missing test data: {path}'
|
||||
return path
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from pathlib import Path
|
|||
from pytest import MonkeyPatch
|
||||
|
||||
from archinstall.default_profiles.profile import CustomSetting, GreeterType
|
||||
from archinstall.lib.args import ArchConfig, ArchConfigHandler, Arguments
|
||||
from archinstall.lib.args import ArchConfig, ArchConfigHandler, Arguments, SubCommand
|
||||
from archinstall.lib.hardware import GfxDriver
|
||||
from archinstall.lib.models.application import (
|
||||
ApplicationConfiguration,
|
||||
|
|
@ -51,7 +51,10 @@ def test_default_args(monkeypatch: MonkeyPatch) -> None:
|
|||
no_pkg_lookups=False,
|
||||
plugin=None,
|
||||
skip_version_check=False,
|
||||
skip_wifi_check=False,
|
||||
advanced=False,
|
||||
verbose=False,
|
||||
command=None,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -359,6 +362,23 @@ def test_encrypted_creds_with_arg(
|
|||
]
|
||||
|
||||
|
||||
def test_skip_wifi_and_verbose_flags(monkeypatch: MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(
|
||||
'sys.argv',
|
||||
[
|
||||
'archinstall',
|
||||
'--skip-wifi-check',
|
||||
'--verbose',
|
||||
],
|
||||
)
|
||||
|
||||
handler = ArchConfigHandler()
|
||||
args = handler.args
|
||||
|
||||
assert args.skip_wifi_check is True
|
||||
assert args.verbose is True
|
||||
|
||||
|
||||
def test_encrypted_creds_with_env_var(
|
||||
monkeypatch: MonkeyPatch,
|
||||
encrypted_creds_fixture: Path,
|
||||
|
|
|
|||
Loading…
Reference in New Issue