diff --git a/src/otk_external_osbuild/command/gen_depsolve_dnf4.py b/src/otk_external_osbuild/command/gen_depsolve_dnf4.py index 5ae734f1..1aa6d0eb 100644 --- a/src/otk_external_osbuild/command/gen_depsolve_dnf4.py +++ b/src/otk_external_osbuild/command/gen_depsolve_dnf4.py @@ -34,7 +34,7 @@ def mockdata(packages): "release": "0", "arch": "noarch", } - for p in packages + for p in packages["include"] + [f"exclude:{p}" for p in packages["exclude"]] ] @@ -42,7 +42,7 @@ def root(input_stream: TextIO) -> None: data = json.loads(input_stream.read()) tree = data["tree"] if "OTK_UNDER_TEST" in os.environ: - packages = mockdata(tree["packages"]["include"]) + packages = mockdata(tree["packages"]) sys.stdout.write(json.dumps(transform(packages))) return diff --git a/test/test_gen_depsolve_dnf4.py b/test/test_gen_depsolve_dnf4.py index b421747f..1bea6e88 100644 --- a/test/test_gen_depsolve_dnf4.py +++ b/test/test_gen_depsolve_dnf4.py @@ -42,6 +42,14 @@ def test_gen_depsolve_dnf4_under_test_mock_data(monkeypatch, capsys): "release": "0", "arch": "noarch", "epoch": "", + }, { + "arch": "noarch", + "checksum": "sha256:93941c24b2276b2050d001b61bab64c58a8df5242bf491fa888f061cca12b51a", + "epoch": "", + "name": "exclude:not-pkg2", + "release": "0", + "remote_location": "https://example.com/repo/packages/exclude:not-pkg2", + "version": "0", }, ], },