Skip to content

livery.forge.testing._fake

livery.forge.testing._fake

An in-memory forge that answers from tables and injects faults on demand.

livery.forge.testing.FakeForge implements livery.forge.Forge without a server: every operation reads and writes plain dictionaries, so a test that would take minutes against a container runs in microseconds. The fake is verified, not trusted: the same conformance suite the real backends must pass runs against it, so behaving like the contract is a tested property.

Beyond the protocol, the fake is the world: driver methods simulate what the git lane and the CI runners would do (a push, a tag, a run finishing), and livery.forge.testing.Faults injects the quirks the real forges have taught, deterministically. Each fault mode has its line in the package's quirks list and a regression test that fails without it.

Classes:

Name Description
Faults

Deterministic fault injection, one attribute per known forge quirk.

FakeForge

A livery.forge.Forge that keeps everything in memory.

FakeDriver

The livery.forge.testing.ForgeDriver over a FakeForge.

Faults dataclass

Faults(lose_arm_schedule: int = 0, merge_405_window: int = 0, wedge_status_queue: bool = False, slow_status_reads: int = 0, drop_connections: int = 0, rate_limited: int = 0, rate_limit_reset: float | None = None)

Deterministic fault injection, one attribute per known forge quirk.

Counters arm a fault for the next N triggering calls and count down as they fire; a flag holds until cleared. Nothing here is random: a test arms exactly the fault it needs and the fake misbehaves exactly that often.

Attributes:

Name Type Description
lose_arm_schedule int

The next N calls to livery.forge.PullRequests.arm succeed silently without recording a schedule, so the pull request reads unarmed afterwards. The lost-auto-merge-schedule quirk.

merge_405_window int

The next N calls to livery.forge.PullRequests.merge_now or livery.forge.PullRequests.arm raise livery.forge.ForgeError with status 405, as a forge does while a mergeability recompute is in flight; the arm shares the merge endpoint, so the window refuses both.

wedge_status_queue bool

While True, runs never leave the queued state: a finished run is not recorded, so the combined status stays pending forever. Cancelling the run is the relief, as it is on a real wedged queue.

slow_status_reads int

The next N calls to livery.forge.Checks.status answer as if nothing had reported for the commit, as a forge does in the window after a push before statuses appear.

drop_connections int

The next N calls to livery.forge.Checks.status or livery.forge.Checks.runs raise livery.forge.ForgeError with no status, as the client does when the server closes the connection without a response mid-poll. The next call answers.

rate_limited int

The next N of those same calls raise livery.forge.RateLimited, as a forge does once the caller's API budget is spent; checked before drop_connections.

rate_limit_reset float | None

The reset time a rate_limited refusal names, as seconds since the epoch; None for a forge that does not say.

Methods:

Name Description
drop

Raise the armed poll fault: a spent budget first, then a dropped one.

lose_arm_schedule class-attribute instance-attribute

lose_arm_schedule: int = 0

merge_405_window class-attribute instance-attribute

merge_405_window: int = 0

wedge_status_queue class-attribute instance-attribute

wedge_status_queue: bool = False

slow_status_reads class-attribute instance-attribute

slow_status_reads: int = 0

drop_connections class-attribute instance-attribute

drop_connections: int = 0

rate_limited class-attribute instance-attribute

rate_limited: int = 0

rate_limit_reset class-attribute instance-attribute

rate_limit_reset: float | None = None

drop

drop(endpoint: str) -> None

Raise the armed poll fault: a spent budget first, then a dropped one.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def drop(self, endpoint: str) -> None:
    """Raise the armed poll fault: a spent budget first, then a dropped one."""
    if self.rate_limited > 0:
        self.rate_limited -= 1
        raise RateLimited(
            f"HTTP 403 on GET {endpoint}: the forge's API rate limit is spent",
            reset_at=self.rate_limit_reset,
            status=403,
            method="GET",
            endpoint=endpoint,
        )
    if self.drop_connections > 0:
        self.drop_connections -= 1
        raise ForgeError(
            f"server unreachable on GET {endpoint}: Remote end closed"
            " connection without response",
            method="GET",
            endpoint=endpoint,
        )

FakeForge

FakeForge(*, user: str = 'fake-user', version: str = '1.0.0', capabilities: tuple[Capability, ...] = _ALL_CAPABILITIES, token: str = '', dispatch_names_run: bool = True)

A livery.forge.Forge that keeps everything in memory.

The protocol half behaves as the conformance suite demands. The driver half simulates the world around the protocol: pushes, tags, and CI runs finishing. Faults are injected through the faults attribute; see livery.forge.testing.Faults.

Pull request and issue numbers count in separate spaces, as GitLab keeps them, so code that mixes the two fails here first.

Parameters:

Name Type Description Default
user str

What livery.forge.Forge.whoami answers.

'fake-user'
version str

What livery.forge.Forge.server_version answers.

'1.0.0'
capabilities tuple[Capability, ...]

What livery.forge.Forge.supports answers True for. Defaults to every known capability; pass a subset to model a forge that declines some by name.

_ALL_CAPABILITIES
dispatch_names_run bool

Whether livery.forge.Checks.dispatch returns the id of the run it started, as every backend's answer names it. False answers None, as a GitHub or Gitea server without the run's details does.

True

Build an empty forge for user with capabilities.

Methods:

Name Description
whoami

The configured user's login name.

server_version

The configured version string.

registry_url

A deterministic registry root per kind, for tests.

supports

Whether capability was granted at construction.

repository

The view onto one repository. Cheap, no existence check.

set_members

Test helper: what members(owner) answers for an org.

set_teams

Test helper: what teams(owner) answers for an org.

members

Configured members; a namespace nobody configured is a user.

teams

Configured teams; a namespace nobody configured has none.

codeowners

The fake's dialect: a root CODEOWNERS, GitHub-shaped.

user_url

The address of login's profile under the fake:// scheme.

set_protection

Test helper: what Repository.protection answers for branch.

review

Test helper: record a submitted review on a pull request.

create_repo

Create the repository with an initialised default branch.

get_repo

The repository's settings, or None when it does not exist.

delete_repo

Delete the repository; a repository already gone is success.

push

Simulate a git push: a new head sha on branch, CI starting.

branch_sha

What branch points at, empty when there is no such branch.

create_tag

Simulate a tag push: tag at the default branch's head.

start_runs

Simulate a runner taking every queued run for sha; none settles.

set_outcome

Change what CI will do with every run for sha that has not settled.

settle

Simulate CI settling: every run for sha reaches its outcome.

comment_bodies

The comments posted on one pull request or issue, oldest first.

Attributes:

Name Type Description
faults Faults
dispatch_names_run bool
budget RateBudget | None
token str

The credential this connection authenticates with; empty when anonymous.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def __init__(
    self,
    *,
    user: str = "fake-user",
    version: str = "1.0.0",
    capabilities: tuple[Capability, ...] = _ALL_CAPABILITIES,
    token: str = "",
    dispatch_names_run: bool = True,
) -> None:
    """Build an empty forge for *user* with *capabilities*."""
    self.faults: Faults = Faults()
    self.dispatch_names_run: bool = dispatch_names_run
    #: The API budget every repository view reports; None, as a forge
    #: that reports none, until a test sets one.
    self.budget: RateBudget | None = None
    self._token = token
    self._user = user
    self._version = version
    self._capabilities = frozenset(capabilities)
    self._repos: dict[tuple[str, str], _RepoState] = {}
    self._members: dict[str, tuple[str, ...]] = {}
    self._teams: dict[str, tuple[str, ...]] = {}
    self._next_sha = 1
    self._next_run = 1
    self._next_job = 1

faults instance-attribute

faults: Faults = Faults()

dispatch_names_run instance-attribute

dispatch_names_run: bool = dispatch_names_run

budget instance-attribute

budget: RateBudget | None = None

token property

token: str

The credential this connection authenticates with; empty when anonymous.

whoami

whoami() -> str

The configured user's login name.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def whoami(self) -> str:
    """The configured user's login name."""
    return self._user

server_version

server_version() -> str

The configured version string.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def server_version(self) -> str:
    """The configured version string."""
    return self._version

registry_url

registry_url(kind: RegistryKind, owner: str) -> str

A deterministic registry root per kind, for tests.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def registry_url(self, kind: RegistryKind, owner: str) -> str:
    """A deterministic registry root per kind, for tests."""
    if kind == "container":
        return f"registry.fake.example/{owner}"
    return f"https://fake.example/api/packages/{owner}/{kind}"

supports

supports(capability: Capability) -> bool

Whether capability was granted at construction.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def supports(self, capability: Capability) -> bool:
    """Whether *capability* was granted at construction."""
    return capability in self._capabilities

repository

repository(owner: str, name: str) -> Repository

The view onto one repository. Cheap, no existence check.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def repository(self, owner: str, name: str) -> Repository:
    """The view onto one repository. Cheap, no existence check."""
    return _FakeRepository(self, owner, name)

set_members

set_members(owner: str, members: tuple[str, ...]) -> None

Test helper: what members(owner) answers for an org.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def set_members(self, owner: str, members: tuple[str, ...]) -> None:
    """Test helper: what ``members(owner)`` answers for an org."""
    self._members[owner] = members

set_teams

set_teams(owner: str, teams: tuple[str, ...]) -> None

Test helper: what teams(owner) answers for an org.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def set_teams(self, owner: str, teams: tuple[str, ...]) -> None:
    """Test helper: what ``teams(owner)`` answers for an org."""
    self._teams[owner] = teams

members

members(owner: str) -> tuple[str, ...]

Configured members; a namespace nobody configured is a user.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def members(self, owner: str) -> tuple[str, ...]:
    """Configured members; a namespace nobody configured is a user."""
    return self._members.get(owner, (owner,))

teams

teams(owner: str) -> tuple[str, ...]

Configured teams; a namespace nobody configured has none.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def teams(self, owner: str) -> tuple[str, ...]:
    """Configured teams; a namespace nobody configured has none."""
    return self._teams.get(owner, ())

codeowners

codeowners(entries: tuple[CodeownersEntry, ...]) -> Codeowners

The fake's dialect: a root CODEOWNERS, GitHub-shaped.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def codeowners(self, entries: tuple[CodeownersEntry, ...]) -> Codeowners:
    """The fake's dialect: a root ``CODEOWNERS``, GitHub-shaped."""
    lines = []
    notes = []
    for entry in entries:
        owners = " ".join(f"@{name}" for name in entry.owners)
        lines.append(f"{entry.path} {owners}")
        if entry.min_approvals > 1:
            notes.append(
                f"{entry.path}: {entry.min_approvals} approvals wanted;"
                " the fake expresses one repository-wide count through"
                " protection, not per path"
            )
    return Codeowners(
        path="CODEOWNERS",
        content="\n".join(lines) + "\n" if lines else "",
        notes=tuple(notes),
    )

user_url

user_url(login: str) -> str

The address of login's profile under the fake:// scheme.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def user_url(self, login: str) -> str:
    """The address of *login*'s profile under the ``fake://`` scheme."""
    return f"fake://{login}"

set_protection

set_protection(owner: str, name: str, branch: str, protection: Protection) -> None

Test helper: what Repository.protection answers for branch.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def set_protection(
    self, owner: str, name: str, branch: str, protection: Protection
) -> None:
    """Test helper: what Repository.protection answers for *branch*."""
    self._require_repo(owner, name).protections[branch] = protection

review

review(owner: str, name: str, number: int, author: str, state: ReviewState) -> None

Test helper: record a submitted review on a pull request.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def review(
    self, owner: str, name: str, number: int, author: str, state: ReviewState
) -> None:
    """Test helper: record a submitted review on a pull request."""
    pr = self._require_pr(self._require_repo(owner, name), number)
    pr.reviews.append(Review(author=author, state=state))

create_repo

create_repo(owner: str, name: str, *, private: bool = True, description: str = '') -> Repository

Create the repository with an initialised default branch.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def create_repo(
    self,
    owner: str,
    name: str,
    *,
    private: bool = True,
    description: str = "",
) -> Repository:
    """Create the repository with an initialised default branch."""
    if (owner, name) in self._repos:
        raise ForgeError(
            f"repository {owner}/{name} already exists",
            status=409,
            method="POST",
            endpoint=f"/repos/{owner}/{name}",
        )
    state = _RepoState(
        owner=owner, name=name, private=private, description=description
    )
    state.branches[state.default_branch] = self._sha()
    self._repos[(owner, name)] = state
    return self.repository(owner, name)

get_repo

get_repo(owner: str, name: str) -> RepoInfo | None

The repository's settings, or None when it does not exist.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def get_repo(self, owner: str, name: str) -> RepoInfo | None:
    """The repository's settings, or None when it does not exist."""
    state = self._repos.get((owner, name))
    if state is None:
        return None
    return RepoInfo(
        owner=state.owner,
        name=state.name,
        default_branch=state.default_branch,
        private=state.private,
    )

delete_repo

delete_repo(owner: str, name: str) -> None

Delete the repository; a repository already gone is success.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def delete_repo(self, owner: str, name: str) -> None:
    """Delete the repository; a repository already gone is success."""
    self._repos.pop((owner, name), None)

push

push(owner: str, name: str, branch: str, *, outcome: Outcome = 'success', sha: str = '') -> str

Simulate a git push: a new head sha on branch, CI starting.

Creates the branch when it is new, moves its head to sha (a rig pairing the fake with a real repository passes the real commit, so sha-keyed reads agree across the seam) or a fresh deterministic one, and queues one run for that sha, as a push trigger would. The run stays queued until livery.forge.testing.FakeForge.settle applies outcome (a hang outcome is released to success there, or cancelled through the protocol). Returns the new head sha.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def push(
    self,
    owner: str,
    name: str,
    branch: str,
    *,
    outcome: Outcome = "success",
    sha: str = "",
) -> str:
    """Simulate a git push: a new head sha on *branch*, CI starting.

    Creates the branch when it is new, moves its head to *sha*
    (a rig pairing the fake with a real repository passes the
    real commit, so sha-keyed reads agree across the seam) or a
    fresh deterministic one, and queues one run for that sha, as
    a push trigger would. The run stays queued until
    livery.forge.testing.FakeForge.settle applies *outcome* (a
    ``hang`` outcome is released to success there, or cancelled
    through the protocol). Returns the new head sha.
    """
    state = self._require_repo(owner, name)
    sha = sha or self._sha()
    state.branches[branch] = sha
    self._start_run(
        state, sha, workflow="ci.yml", event="push", outcome=outcome, ref=branch
    )
    return sha

branch_sha

branch_sha(owner: str, name: str, branch: str) -> str

What branch points at, empty when there is no such branch.

The counterpart of livery.forge.testing.FakeForge.push, for a test that has to name a head it did not push: what a merge left on the base, which is the sha the base's own runs are filed under.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def branch_sha(self, owner: str, name: str, branch: str) -> str:
    """What *branch* points at, empty when there is no such branch.

    The counterpart of livery.forge.testing.FakeForge.push, for a
    test that has to name a head it did not push: what a merge
    left on the base, which is the sha the base's own runs are
    filed under.
    """
    return self._require_repo(owner, name).branches.get(branch, "")

create_tag

create_tag(owner: str, name: str, tag: str) -> None

Simulate a tag push: tag at the default branch's head.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def create_tag(self, owner: str, name: str, tag: str) -> None:
    """Simulate a tag push: *tag* at the default branch's head."""
    state = self._require_repo(owner, name)
    state.tags[tag] = state.branches[state.default_branch]

start_runs

start_runs(owner: str, name: str, sha: str) -> None

Simulate a runner taking every queued run for sha; none settles.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def start_runs(self, owner: str, name: str, sha: str) -> None:
    """Simulate a runner taking every queued run for *sha*; none settles."""
    state = self._require_repo(owner, name)
    for run_state in state.runs.values():
        if run_state.head_sha == sha and run_state.status == "queued":
            run_state.status = "running"
            run_state.started_at = _stamp(run_state.id * 60 + 3)

set_outcome

set_outcome(owner: str, name: str, sha: str, outcome: Outcome) -> None

Change what CI will do with every run for sha that has not settled.

A re-run reaches the outcome set here when it settles, so a rig can make the second attempt of a red run pass, as a flaky runner would.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def set_outcome(self, owner: str, name: str, sha: str, outcome: Outcome) -> None:
    """Change what CI will do with every run for *sha* that has not settled.

    A re-run reaches the outcome set here when it settles, so a
    rig can make the second attempt of a red run pass, as a
    flaky runner would.
    """
    state = self._require_repo(owner, name)
    for run_state in state.runs.values():
        if run_state.head_sha == sha and run_state.status != "completed":
            run_state.outcome = outcome

settle

settle(owner: str, name: str, sha: str) -> None

Simulate CI settling: every run for sha reaches its outcome.

A held (hang) run is released and concludes success, per the driver contract. While livery.forge.testing.Faults.wedge_status_queue holds, the results are silently dropped and the runs stay queued, which is what a wedged queue does to finished jobs. Settle again after clearing the fault.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def settle(self, owner: str, name: str, sha: str) -> None:
    """Simulate CI settling: every run for *sha* reaches its outcome.

    A held (``hang``) run is released and concludes success, per
    the driver contract. While
    livery.forge.testing.Faults.wedge_status_queue holds, the
    results are silently dropped and the runs stay queued, which
    is what a wedged queue does to finished jobs. Settle again
    after clearing the fault.
    """
    state = self._require_repo(owner, name)
    if self.faults.wedge_status_queue:
        return
    for run_state in state.runs.values():
        if run_state.head_sha != sha or run_state.status == "completed":
            continue
        conclusion: Conclusion = (
            "success" if run_state.outcome == "hang" else run_state.outcome
        )
        run_state.status = "completed"
        run_state.conclusion = conclusion
        run_state.log = f"job {run_state.job_id} concluded {conclusion}"
        # The settled run is timed like a real one: queued three
        # seconds, then a thirty-second job of one step.
        run_state.started_at = _stamp(run_state.id * 60 + 3)
        run_state.completed_at = _stamp(run_state.id * 60 + 33)
        run_state.steps = (
            Step("gate", conclusion, run_state.started_at, run_state.completed_at),
        )
    self._settle(state)

comment_bodies

comment_bodies(owner: str, name: str, number: int, *, kind: Literal['pr', 'issue']) -> tuple[str, ...]

The comments posted on one pull request or issue, oldest first.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def comment_bodies(
    self, owner: str, name: str, number: int, *, kind: Literal["pr", "issue"]
) -> tuple[str, ...]:
    """The comments posted on one pull request or issue, oldest first."""
    state = self._require_repo(owner, name)
    if kind == "pr":
        return tuple(self._require_pr(state, number).comments)
    return tuple(self._require_issue(state, number).comments)

FakeDriver

FakeDriver(fake: FakeForge | None = None)

The livery.forge.testing.ForgeDriver over a FakeForge.

The reference driver: it makes the conformance scenarios runnable with no server at all, and shows a real backend's test rig what it must supply.

Parameters:

Name Type Description Default
fake FakeForge | None

The forge to drive. A fresh full-capability one when omitted.

None

Bind the driver to fake, creating one when omitted.

Methods:

Name Description
unused_repo_name

An owner and name no repository has yet.

fresh_repo

A new repository with an initialised default branch.

push

Push branch with outcome and return its new head sha.

create_tag

Create tag at the default branch's head.

settle

Apply every pushed outcome for sha; immediate on the fake.

await_run

The one run matching the filters; the fake never waits.

comment_bodies

The comments on one pull request or issue, oldest first.

await_mergeable

The fake computes mergeability synchronously: nothing to await.

await_merged

The fake merges inside settle: nothing to await.

await_branch

The fake is immediately consistent.

await_issue

The fake's listings are immediate: only verify the state.

required_context

The fake reports checks under the plain job name.

Attributes:

Name Type Description
fake FakeForge
forge FakeForge

The forge under test.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def __init__(self, fake: FakeForge | None = None) -> None:
    """Bind the driver to *fake*, creating one when omitted."""
    self.fake: FakeForge = fake if fake is not None else FakeForge()
    self._counter = 0

fake instance-attribute

fake: FakeForge = fake if fake is not None else FakeForge()

forge property

forge: FakeForge

The forge under test.

unused_repo_name

unused_repo_name() -> tuple[str, str]

An owner and name no repository has yet.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def unused_repo_name(self) -> tuple[str, str]:
    """An owner and name no repository has yet."""
    self._counter += 1
    return ("acme", f"repo-{self._counter}")

fresh_repo

fresh_repo() -> Repository

A new repository with an initialised default branch.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def fresh_repo(self) -> Repository:
    """A new repository with an initialised default branch."""
    owner, name = self.unused_repo_name()
    # An org shape for the listings: the caller is a member, as
    # on any real forge the scenarios run against.
    self.fake.set_members(owner, (self.fake.whoami(), "colleague"))
    self.fake.set_teams(owner, ("core",))
    return self.fake.create_repo(owner, name)

push

push(repo_owner: str, repo_name: str, branch: str, *, outcome: Outcome = 'success') -> str

Push branch with outcome and return its new head sha.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def push(
    self,
    repo_owner: str,
    repo_name: str,
    branch: str,
    *,
    outcome: Outcome = "success",
) -> str:
    """Push *branch* with *outcome* and return its new head sha."""
    return self.fake.push(repo_owner, repo_name, branch, outcome=outcome)

create_tag

create_tag(repo_owner: str, repo_name: str, tag: str) -> None

Create tag at the default branch's head.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def create_tag(self, repo_owner: str, repo_name: str, tag: str) -> None:
    """Create *tag* at the default branch's head."""
    self.fake.create_tag(repo_owner, repo_name, tag)

settle

settle(repo_owner: str, repo_name: str, sha: str) -> None

Apply every pushed outcome for sha; immediate on the fake.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def settle(self, repo_owner: str, repo_name: str, sha: str) -> None:
    """Apply every pushed outcome for *sha*; immediate on the fake."""
    self.fake.settle(repo_owner, repo_name, sha)

await_run

await_run(repo_owner: str, repo_name: str, *, head_sha: str = '', event: str = '') -> Run

The one run matching the filters; the fake never waits.

Raises AssertionError unless exactly one run matches, which is the driver contract.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def await_run(
    self, repo_owner: str, repo_name: str, *, head_sha: str = "", event: str = ""
) -> Run:
    """The one run matching the filters; the fake never waits.

    Raises AssertionError unless exactly one run matches, which is
    the driver contract.
    """
    runs = self.fake.repository(repo_owner, repo_name).checks.runs(
        head_sha=head_sha, event=event
    )
    assert len(runs) == 1, f"expected one matching run, found {len(runs)}"
    return runs[0]

comment_bodies

comment_bodies(repo_owner: str, repo_name: str, number: int, *, kind: Literal['pr', 'issue']) -> tuple[str, ...]

The comments on one pull request or issue, oldest first.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def comment_bodies(
    self,
    repo_owner: str,
    repo_name: str,
    number: int,
    *,
    kind: Literal["pr", "issue"],
) -> tuple[str, ...]:
    """The comments on one pull request or issue, oldest first."""
    return self.fake.comment_bodies(repo_owner, repo_name, number, kind=kind)

await_mergeable

await_mergeable(repo_owner: str, repo_name: str, number: int) -> None

The fake computes mergeability synchronously: nothing to await.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def await_mergeable(self, repo_owner: str, repo_name: str, number: int) -> None:
    """The fake computes mergeability synchronously: nothing to await."""
    self.fake._require_pr(self.fake._require_repo(repo_owner, repo_name), number)

await_merged

await_merged(repo_owner: str, repo_name: str, number: int) -> None

The fake merges inside settle: nothing to await.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def await_merged(self, repo_owner: str, repo_name: str, number: int) -> None:
    """The fake merges inside settle: nothing to await."""
    self.fake._require_pr(self.fake._require_repo(repo_owner, repo_name), number)

await_branch

await_branch(repo_owner: str, repo_name: str, branch: str, *, present: bool) -> None

The fake is immediately consistent.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def await_branch(
    self, repo_owner: str, repo_name: str, branch: str, *, present: bool
) -> None:
    """The fake is immediately consistent."""

await_issue

await_issue(repo_owner: str, repo_name: str, number: int, *, assignee: str = '') -> None

The fake's listings are immediate: only verify the state.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def await_issue(
    self, repo_owner: str, repo_name: str, number: int, *, assignee: str = ""
) -> None:
    """The fake's listings are immediate: only verify the state."""
    issue = self.fake._require_issue(
        self.fake._require_repo(repo_owner, repo_name), number
    )
    assert not assignee or assignee in issue.assignees

required_context

required_context() -> str

The fake reports checks under the plain job name.

Source code in packages/forge/src/livery/forge/testing/_fake.py
def required_context(self) -> str:
    """The fake reports checks under the plain job name."""
    return "gate"