Skip to content

TestClient: support enqueueing incoming KI calls to make the handling loop unit-testable #22

@DaviddeBest-TNO

Description

@DaviddeBest-TNO

Problem

TestClient.poll_ki_call unconditionally returns (PollResult.REPOLL, None). The HANDLE and EXIT paths in start_handling_loop are dead code from a testing perspective — no unit test can reach them. The only handling-loop test checks that it raises when the KB is unregistered.

TestClient already has a mocking pattern (mock_result_binding_set for outgoing interactions) but lacks the equivalent for incoming calls.

Proposed solution

Add enqueue_handle_request(ki_name, binding_set) to TestClient. poll_ki_call drains the queue, returning a HandleRequest for each queued item before falling back to REPOLL. An enqueue_exit() helper covers the EXIT path.

Benefits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions