Esempio n. 1
0
 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())
Esempio n. 2
0
 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())
Esempio n. 3
0
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()