Skip to content

Commit

Permalink
WIP: fix repolib tests for apt. mock apt
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Aug 2, 2024
1 parent 0f6741a commit 085b20e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_repolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
# the class is not defined in the first place
deb_mock = MagicMock()
deb_mock.Deb822 = dict
with patch.dict("rhsm.repofile.sys.modules", {"debian.deb822": deb_mock}):
apt_mock = MagicMock()
apt_mock.Cache = dict
with patch.dict("rhsm.repofile.sys.modules", {"debian.deb822": deb_mock, "apt": apt_mock}):
reload(repofile)
from rhsm.repofile import AptRepoFile
reload(repofile)
Expand Down Expand Up @@ -908,7 +910,7 @@ def test_releasever_the_string_none(self):

class AptRepoFileTest(unittest.TestCase):
def _helper_stub_repo(self, *args, **kwargs):
with patch("rhsm.repofile.apt", True):
with patch("rhsm.repofile.apt", dict):
repo = Repo(*args, **kwargs)
return repo

Expand Down

0 comments on commit 085b20e

Please sign in to comment.