diff --git a/archivebox/config/collection.py b/archivebox/config/collection.py index 61c03b9b..f80bae2d 100644 --- a/archivebox/config/collection.py +++ b/archivebox/config/collection.py @@ -326,7 +326,7 @@ def write_config_file(config: dict[str, str]) -> AttrDict: # validate the updated_config by attempting to re-parse it from archivebox.config.common import get_config - updated_config = get_config().as_dict() + updated_config = get_config(include_machine=False).as_dict() except BaseException: # lgtm [py/catch-base-exception] # something went horribly wrong, revert to the previous version with open(f"{config_path}.bak", encoding="utf-8") as old: diff --git a/archivebox/tests/test_cli_config.py b/archivebox/tests/test_cli_config.py index 18ca9215..90ff8c62 100644 --- a/archivebox/tests/test_cli_config.py +++ b/archivebox/tests/test_cli_config.py @@ -87,6 +87,7 @@ def test_config_set_writes_to_file(initialized_archive): ) assert result.returncode == 0 + assert "TIMEOUT=120" in result.stdout # Verify config file was updated config_file = initialized_archive / "ArchiveBox.conf" @@ -104,12 +105,19 @@ def test_config_set_and_get_roundtrip(initialized_archive): ["config", "--set", "TIMEOUT=987"], ) + updated = run_archivebox_cmd( + ["config", "--set", "TIMEOUT=654"], + ) + + assert updated.returncode == 0 + assert "TIMEOUT=654" in updated.stdout + # Get the value back result = run_archivebox_cmd( ["config", "--get", "TIMEOUT"], ) - assert "987" in result.stdout + assert "654" in result.stdout def test_config_set_multiple_values(initialized_archive):