From: Daan De Meyer Date: Fri, 13 Feb 2026 08:11:52 +0000 (+0100) Subject: test: Add test covering the history with empty lists X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c00490a1e184f1a5ec00714065c35e359211f5d3;p=thirdparty%2Fmkosi.git test: Add test covering the history with empty lists --- diff --git a/tests/test_config.py b/tests/test_config.py index 0076df8c4..cee25cfa9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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 == []