示例#1
0
 def is_installed(self):
     # (cp16net) could raise an exception, does it need to be handled here?
     version = pkg.pkg_version(self.MYSQL_PACKAGE_VERSION)
     return not version is None
示例#2
0
文件: test_pkg.py 项目: dfecker/trove
 def test_version_no_version(self):
     cmd_out = self.build_output(self.pkgName, '<none>')
     commands.getstatusoutput = Mock(return_value=(0, cmd_out))
     self.assertFalse(pkg.pkg_version(self.pkgName))
示例#3
0
文件: test_pkg.py 项目: dfecker/trove
 def test_version_status_error(self):
     cmd_out = self.build_output(self.pkgName, self.pkgVersion)
     commands.getstatusoutput = Mock(return_value=(1, cmd_out))
     self.assertFalse(pkg.pkg_version(self.pkgName))
示例#4
0
文件: test_pkg.py 项目: dfecker/trove
 def test_version_unknown_package(self):
     unk_parts = "un   " + self.pkgName + "   " + self.pkgVersion + "   \n"
     cmd_out = self.build_output(self.pkgName, self.pkgVersion, unk_parts)
     commands.getstatusoutput = Mock(return_value=(0, cmd_out))
     self.assertFalse(pkg.pkg_version(self.pkgName))
示例#5
0
文件: test_pkg.py 项目: dfecker/trove
 def test_version_success(self):
     cmd_out = self.build_output(self.pkgName, self.pkgVersion)
     commands.getstatusoutput = Mock(return_value=(0, cmd_out))
     version = pkg.pkg_version(self.pkgName)
     self.assertTrue(version)
     self.assertEqual(self.pkgVersion, version)