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']()
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
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)
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)