package terminus
Module Terminus.MockSource
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 withexpected.Put (path, expected)works the same way asPostDelete 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.
Exception raised when on field in an header mismatch.
A Mock backend is an implementation of the S module with a mock backend.
Source
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.