Skip to content

Commit

Permalink
gen-depsolve-dnf4: adjust mockdata() for new exclude: prefix
Browse files Browse the repository at this point in the history
This commit follows osbuild/images#938
and adjust the way excludes are represented.
  • Loading branch information
mvo5 committed Sep 24, 2024
1 parent 6d4d50a commit 4d1d8e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/otk_external_osbuild/command/gen_depsolve_dnf4.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def mockdata(packages):
"release": "0",
"arch": "noarch",
}
for p in packages
for p in packages["include"] + [f"exclude:{p}" for p in packages["exclude"]]
]


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

Expand Down
8 changes: 8 additions & 0 deletions test/test_gen_depsolve_dnf4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
Expand Down

0 comments on commit 4d1d8e3

Please sign in to comment.