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_zypper.pkg_installed(node, "foo"))
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_zypper.pkg_installed(node, "foo"))