Gralkor.Client.InMemory (gralkor v1.2.0)

Copy Markdown View Source

In-memory twin of Gralkor.Client for tests.

Configure responses per operation before exercising the code under test; inspect the calls that were made after. Operations with no configured response return {:error, :not_configured} — tests should set every response they expect the code under test to hit.

Summary

Functions

Returns a specification to start this module under a supervisor.

Reset all state — call in setup.

Set the response for the next (and all subsequent) build_communities/1 calls.

Set the response for the next (and all subsequent) build_indices/0 calls.

Set the response for the next (and all subsequent) capture/3 calls.

Set the response for the next (and all subsequent) end_session/1 calls.

Set the response for the next (and all subsequent) health_check/0 calls.

Set the response for the next (and all subsequent) memory_add/3 calls.

Set the response for the next (and all subsequent) memory_search/3 calls.

Set the response for the next (and all subsequent) recall/3 calls.

Functions

adds()

captures()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

communities_builds()

end_sessions()

health_checks()

indices_builds()

recalls()

reset()

Reset all state — call in setup.

searches()

set_build_communities(response)

Set the response for the next (and all subsequent) build_communities/1 calls.

set_build_indices(response)

Set the response for the next (and all subsequent) build_indices/0 calls.

set_capture(response)

Set the response for the next (and all subsequent) capture/3 calls.

set_end_session(response)

Set the response for the next (and all subsequent) end_session/1 calls.

set_health(response)

Set the response for the next (and all subsequent) health_check/0 calls.

set_memory_add(response)

Set the response for the next (and all subsequent) memory_add/3 calls.

set_memory_search(response)

Set the response for the next (and all subsequent) memory_search/3 calls.

set_recall(response)

Set the response for the next (and all subsequent) recall/3 calls.

start_link(opts \\ [])