CredentialEchoChecks

org.llm4s.testkit.CredentialEchoChecks

End-to-end check that a credential a provider echoes back in its error body never reaches the LLMError message. A client spec builds the client with key as its credential, points it at the local server assertNotEchoed starts, and makes one call.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def assertHidesKey(key: String, result: Either[LLMError, _]): Unit

Fails unless result is a Left whose message holds none of key's forms. For a client with no base URL, called over a stub HTTP client that answers 401 with echoBody.

Fails unless result is a Left whose message holds none of key's forms. For a client with no base URL, called over a stub HTTP client that answers 401 with echoBody.

Attributes

def assertNotEchoed(key: String)(call: String => Either[LLMError, _]): Unit

Starts a local server answering every request with HTTP 401 and echoBody, runs call(baseUrl), and fails unless the server saw a request and the call returns a Left whose message holds none of key's forms.

Starts a local server answering every request with HTTP 401 and echoBody, runs call(baseUrl), and fails unless the server saw a request and the call returns a Left whose message holds none of key's forms.

Attributes

def echoBody(key: String): String

An error body echoing key raw, inside a JSON string, JSON-escaped and URL-encoded.

An error body echoing key raw, inside a JSON string, JSON-escaped and URL-encoded.

Attributes