Skip to content

Commit

Permalink
test: create fake etc/apt/preferences.d to silence test warnings
Browse files Browse the repository at this point in the history
Apt expects the /etc/apt/preferences.d so create it in the fakeroot
dirs for the tests to silence the apt warning visible in pytest.
  • Loading branch information
mvo5 committed Nov 9, 2024
1 parent 6d7557a commit edb2f8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def make_fake_aptroot(self, template=None, fake_pkgs=[]):
self.addCleanup(shutil.rmtree, tmpdir)
aptroot = os.path.join(tmpdir, "aptroot")
shutil.copytree(template, aptroot)
# apt warns if this dir does not exist
os.makedirs(os.path.join(aptroot, "etc/apt/preferences.d"))
# fake dpkg status
mock_dpkg_status = os.path.join(aptroot, "var/lib/dpkg/status")
with open(mock_dpkg_status, "a") as fp:
Expand Down

0 comments on commit edb2f8b

Please sign in to comment.