mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Report newly written config values
This commit is contained in:
parent
4b4cd5dacd
commit
ff555e87c3
@ -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:
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user