def test_not_installed(self): runresult = RunResult() runresult.return_code = 1 runresult.stdout = "error: package 'foo' was not found" node = MagicMock() node.run.return_value = runresult self.assertFalse(pkg_pacman.pkg_installed(node, "foo"))
def test_installed(self): runresult = RunResult() runresult.return_code = 0 runresult.stdout = "foo 1.0.0-1\n" node = MagicMock() node.run.return_value = runresult self.assertTrue(pkg_pacman.pkg_installed(node, "foo"))