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")
Example #2
0
 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'))
Example #3
0
 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'))