From cd48e4d36b354d0b34d76be1dd3e44b121e58f87 Mon Sep 17 00:00:00 2001 From: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com> Date: Sat, 6 Jun 2026 08:38:34 +0000 Subject: [PATCH] chore: improve archinstall maintenance path --- tests/conftest.py | 40 ++++++++++++++++++++++++++++++---------- tests/test_args.py | 22 +++++++++++++++++++++- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 819c8397..8a7c2b22 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 diff --git a/tests/test_args.py b/tests/test_args.py index 4cbad41b..954169eb 100644 --- a/tests/test_args.py +++ b/tests/test_args.py @@ -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,