def test_refresh_db(self): ''' Test if it updates the pkgutil repo database (pkgutil -U). ''' mock = MagicMock(return_value=0) with patch.dict(pkgutil.__salt__, {'cmd.retcode': mock}): self.assertTrue(pkgutil.refresh_db())
def test_refresh_db(): """ Test if it updates the pkgutil repo database (pkgutil -U). """ mock = MagicMock(return_value=0) with patch.dict(pkgutil.__salt__, {"cmd.retcode": mock}): with patch.object(salt.utils.pkg, "clear_rtag", Mock()): assert pkgutil.refresh_db()