def METHOD_NAME(self):
    self.mock_sm.return_value.check_installed = lambda check_installed: False
    runnable = Runnable(
        kind="package", uri=None, **{"action": "check", "name": "foo"}
    )
    runner = PackageRunner()
    status = runner.run(runnable)
    messages = []
    while True:
        try:
            messages.append(next(status))
        except StopIteration:
            break
    self.assertEqual(messages[-1]["result"], "error")
    stderr = b"Package foo not installed"
    self.assertIn(stderr, messages[-2]["log"])