]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
test: Add test covering the history with empty lists 4163/head
authorDaan De Meyer <daan@amutable.com>
Fri, 13 Feb 2026 08:11:52 +0000 (09:11 +0100)
committerDaan De Meyer <daan@amutable.com>
Fri, 13 Feb 2026 13:39:58 +0000 (14:39 +0100)
tests/test_config.py

index 0076df8c428223354eeb3fd2bc6f0bd6c4a0fc36..cee25cfa9632b7bc4638fd3ce7ce7472f4728ccc 100644 (file)
@@ -1899,3 +1899,30 @@ def test_initrds_custom_only(tmp_path: Path) -> None:
 
     assert len(config.initrds) == 1
     assert config.initrds[0] == d / "myinitrd.cpio"
+
+
+def test_history_empty_list(tmp_path: Path) -> None:
+    d = tmp_path
+
+    (d / "packages").mkdir()
+
+    (d / "mkosi.conf").write_text(
+        """\
+        [Build]
+        History=yes
+
+        [Content]
+        PackageDirectories=packages
+        """
+    )
+
+    with chdir(d):
+        _, _, [main] = parse_config(["--package-directory=", "build"])
+
+    assert (d / ".mkosi-private/history/latest.json").exists()
+    assert main.package_directories == []
+
+    with chdir(d):
+        _, _, [main] = parse_config(["summary"])
+
+    assert main.package_directories == []