Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
The query type defines the interaction with the API:
Get path
: tries to execute the GET method on a specific path in the APIPost (path, expected)
defines a POST method on a path and verify the input with expected
.Put (path, expected)
works the same way as Post
Delete path
executes a DELETE method on a specific pathval pp_query :
Ppx_deriving_runtime.Format.formatter ->
query ->
Ppx_deriving_runtime.unit
val show_query : query -> Ppx_deriving_runtime.string
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.