def test_version(): """ Test if it returns a version if the package is installed. """ mock_ret = MagicMock(return_value=True) with patch.dict(pkgutil.__salt__, {"pkg_resource.version": mock_ret}): assert pkgutil.version("CSWpython")
def test_version(self): ''' Test if it returns a version if the package is installed. ''' mock_ret = MagicMock(return_value=True) with patch.dict(pkgutil.__salt__, {'pkg_resource.version': mock_ret}): self.assertTrue(pkgutil.version('CSWpython'))