The query type defines the interaction with the API:
Get path: tries to execute the GET method on a specific path in the API
Post (path, expected)defines a POST method on a path and verify the input with
Put (path, expected)works the same way as
Delete pathexecutes a DELETE method on a specific path
Exception raised when you are trying to execute a request on a wrong url or when urls mismatched.
module type Mock_backend = sig ... end
A Mock backend is an implementation of the
S module with a mock backend.
val mock : address:string -> expected_headers:(string * string) list -> expect:(query * string) list -> unit -> (module Mock_backend)
mock ~address ~expected_headers ~expect () creates a new mock backend with some checks in it. The
address is the endpoint for the API. the
expected_headers are the data that should be found at each request in the header.
expect is a list of
query with the answer expected when you execute the request.