tools/test/depsolve: remove checks for errors where unnecessary
Requests in some test cases are expected to always succeed. Don't check for errors in such test cases. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
26de07737b
commit
e7d9446023
1 changed files with 0 additions and 18 deletions
|
|
@ -1500,12 +1500,6 @@ def test_depsolve_config_combos(tmp_path, repo_servers, dnf_config, detect_fn):
|
|||
res, exit_code = depsolve(
|
||||
transactions, cache_dir, dnf_config, repo_configs, root_dir, opt_metadata)
|
||||
|
||||
if test_case.get("error", False):
|
||||
assert exit_code != 0
|
||||
assert res["kind"] == test_case["error_kind"]
|
||||
assert re.match(test_case["error_reason_re"], res["reason"], re.DOTALL)
|
||||
continue
|
||||
|
||||
assert exit_code == 0
|
||||
assert {pkg["name"] for pkg in res["packages"]} == test_case["results"]["packages"]
|
||||
assert res["repos"].keys() == test_case["results"]["reponames"]
|
||||
|
|
@ -1547,12 +1541,6 @@ def test_depsolve_sbom(tmp_path, repo_servers, dnf_config, detect_fn, with_sbom)
|
|||
|
||||
res, exit_code = depsolve(transactions, tmp_path.as_posix(), dnf_config, repo_configs, with_sbom=with_sbom)
|
||||
|
||||
if test_case.get("error", False):
|
||||
assert exit_code != 0
|
||||
assert res["kind"] == test_case["error_kind"]
|
||||
assert re.match(test_case["error_reason_re"], res["reason"], re.DOTALL)
|
||||
return
|
||||
|
||||
assert exit_code == 0
|
||||
assert {pkg["name"] for pkg in res["packages"]} == test_case["results"]["packages"]
|
||||
assert res["repos"].keys() == test_case["results"]["reponames"]
|
||||
|
|
@ -1704,12 +1692,6 @@ def test_search_config_combos(tmp_path, repo_servers, dnf_config, detect_fn):
|
|||
with TemporaryDirectory() as cache_dir:
|
||||
res, exit_code = search(search_args, cache_dir, dnf_config, repo_configs, root_dir, opt_metadata)
|
||||
|
||||
if test_case.get("error", False):
|
||||
assert exit_code != 0
|
||||
assert res["kind"] == test_case["error_kind"]
|
||||
assert re.match(test_case["error_reason_re"], res["reason"], re.DOTALL)
|
||||
continue
|
||||
|
||||
assert exit_code == 0
|
||||
for res, exp in zip(res, test_case["results"]):
|
||||
# if the url in the package is empty, DNF4 returns None, DNF5 returns an empty string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue