예제 #1
0
 def test_not_installed(self):
     runresult = RunResult()
     runresult.return_code = 1
     runresult.stdout = "Error: No matching Packages to list\n"
     node = MagicMock()
     node.run.return_value = runresult
     self.assertFalse(pkg_yum.pkg_installed(node, "foo"))
예제 #2
0
 def test_installed(self):
     runresult = RunResult()
     runresult.return_code = 0
     runresult.stdout = "Status: install ok installed\n"
     node = MagicMock()
     node.run.return_value = runresult
     self.assertTrue(pkg_yum.pkg_installed(node, "foo"))