def METHOD_NAME(self, *, failed: bool, cancelled: bool = False):
    """Make the check_build_outcome method return the specified values."""
    if cancelled and not failed:
        raise ValueError(
            "Cannot set build outcome (failed=False, cancelled=True), "
            "cancelled=True implies failed=True"
        )
    outcome = (failed, cancelled)
    flexmock(self.workflow).should_receive("check_build_outcome").and_return(outcome)
    return self