Handle gracefully debian stuff when testing on rhel-like
Some checks failed
Some checks failed
This commit is contained in:
parent
b704a6c80b
commit
ce2652a3b3
2 changed files with 12 additions and 1 deletions
|
|
@ -186,7 +186,12 @@ def parse_status_conffiles(
|
|||
if m:
|
||||
out[pkg] = m
|
||||
|
||||
with open(status_path, "r", encoding="utf-8", errors="replace") as f:
|
||||
try:
|
||||
f = open(status_path, "r", encoding="utf-8", errors="replace")
|
||||
except OSError:
|
||||
return out
|
||||
|
||||
with f:
|
||||
for line in f:
|
||||
if line.strip() == "":
|
||||
if cur:
|
||||
|
|
|
|||
|
|
@ -280,6 +280,12 @@ def test_build_dpkg_etc_index_skips_non_etc_paths(tmp_path: Path):
|
|||
assert "foo" not in topdir_to_pkgs
|
||||
|
||||
|
||||
def test_parse_status_conffiles_handles_missing_status(tmp_path: Path):
|
||||
import enroll.debian as d
|
||||
|
||||
assert d.parse_status_conffiles(str(tmp_path / "missing-status")) == {}
|
||||
|
||||
|
||||
def test_parse_status_conffiles_handles_empty_status(tmp_path: Path):
|
||||
import enroll.debian as d
|
||||
|
||||
|
|
|
|||
Reference in a new issue