示例#1
0
 def test_version(self):
     '''
     Test - Returns a string representing the package version or an empty string if
     not installed.
     '''
     assert aptpkg.version(
         *['wget']) == aptpkg.__salt__['pkg_resource.version']()
示例#2
0
def test_version(lowpkg_info_var):
    """
    Test - Returns a string representing the package version or an empty string if
    not installed.
    """
    version = lowpkg_info_var["wget"]["version"]
    mock = MagicMock(return_value=version)
    with patch.dict(aptpkg.__salt__, {"pkg_resource.version": mock}):
        assert aptpkg.version(*["wget"]) == version
示例#3
0
 def test_version(self):
     '''
     Test - Returns a string representing the package version or an empty string if
     not installed.
     '''
     version = LOWPKG_INFO['wget']['version']
     mock = MagicMock(return_value=version)
     with patch.dict(aptpkg.__salt__, {'pkg_resource.version': mock}):
         self.assertEqual(aptpkg.version(*['wget']), version)
示例#4
0
 def test_version(self):
     """
     Test - Returns a string representing the package version or an empty string if
     not installed.
     """
     version = LOWPKG_INFO["wget"]["version"]
     mock = MagicMock(return_value=version)
     with patch.dict(aptpkg.__salt__, {"pkg_resource.version": mock}):
         self.assertEqual(aptpkg.version(*["wget"]), version)
示例#5
0
 def test_version(self):
     '''
     Test - Returns a string representing the package version or an empty string if
     not installed.
     '''
     version = LOWPKG_INFO['wget']['version']
     mock = MagicMock(return_value=version)
     with patch.dict(aptpkg.__salt__, {'pkg_resource.version': mock}):
         self.assertEqual(aptpkg.version(*['wget']), version)