def test_upgrade_not_available(self): ''' Test upgrade_available when an update is not available. ''' ret = MagicMock(return_value='') with patch('salt.modules.openbsdpkg.latest_version', ret): self.assertFalse(openbsdpkg.upgrade_available('zsh'))
def test_upgrade_not_available(): """ Test upgrade_available when an update is not available. """ ret = MagicMock(return_value="") with patch("salt.modules.openbsdpkg.latest_version", ret): assert not openbsdpkg.upgrade_available("zsh")
def test_upgrade_available(self): """ Test upgrade_available when an update is available. """ ret = MagicMock(return_value="5.4.2p0") with patch("salt.modules.openbsdpkg.latest_version", ret): self.assertTrue(openbsdpkg.upgrade_available("zsh"))