Module Opium_testing
This module provides helpers to easily test Opium applications with Alcotest.
Testable
module Testable : sig ... end
Collection of
Alcotest
testables forOpium
types.
handle_request
val handle_request : Opium.App.t -> Opium.Request.t -> Opium.Response.t Lwt.t
handle_request app request response
processes a requestrequest
with the given Opium applicationapp
.It processes the request the same
Opium.Server_connection.run
would and returns the generated response.
check_status
val check_status : ?msg:string -> Opium.Status.t -> Opium.Status.t -> unit
check_status ?msg t1 t2
checks that the statust1
andt2
are equal.
check_status'
val check_status' : ?msg:string -> expected:Opium.Status.t -> actual:Opium.Status.t -> unit
check_status' ?msg t1 t2
checks that the statust1
andt2
are equal.This is a labeled variant of
check_status
check_meth
val check_meth : ?msg:string -> Opium.Method.t -> Opium.Method.t -> unit
check_meth ?msg t1 t2
checks that the methodt1
andt2
are equal.
check_meth'
val check_meth' : ?msg:string -> expected:Opium.Method.t -> actual:Opium.Method.t -> unit
check_meth' ?msg t1 t2
checks that the methodt1
andt2
are equal.This is a labeled variant of
check_meth
check_version
val check_version : ?msg:string -> Opium.Version.t -> Opium.Version.t -> unit
check_version ?msg t1 t2
checks that the versiont1
andt2
are equal.
check_version'
val check_version' : ?msg:string -> expected:Opium.Version.t -> actual:Opium.Version.t -> unit
check_version' ?msg t1 t2
checks that the versiont1
andt2
are equal.This is a labeled variant of
check_version
check_body
val check_body : ?msg:string -> Opium.Body.t -> Opium.Body.t -> unit
check_body ?msg t1 t2
checks that the bodyt1
andt2
are equal.
check_body'
val check_body' : ?msg:string -> expected:Opium.Body.t -> actual:Opium.Body.t -> unit
check_body' ?msg t1 t2
checks that the bodyt1
andt2
are equal.This is a labeled variant of
check_body
check_request
val check_request : ?msg:string -> Opium.Request.t -> Opium.Request.t -> unit
check_request ?msg t1 t2
checks that the requestt1
andt2
are equal.
check_request'
val check_request' : ?msg:string -> expected:Opium.Request.t -> actual:Opium.Request.t -> unit
check_request' ?msg t1 t2
checks that the requestt1
andt2
are equal.This is a labeled variant of
check_request
check_response
val check_response : ?msg:string -> Opium.Response.t -> Opium.Response.t -> unit
check_response ?msg t1 t2
checks that the responset1
andt2
are equal.
check_response'
val check_response' : ?msg:string -> expected:Opium.Response.t -> actual:Opium.Response.t -> unit
check_response' ?msg t1 t2
checks that the responset1
andt2
are equal.This is a labeled variant of
check_response
check_cookie
val check_cookie : ?msg:string -> Opium.Cookie.t -> Opium.Cookie.t -> unit
check_cookie ?msg t1 t2
checks that the cookiet1
andt2
are equal.
check_cookie'
val check_cookie' : ?msg:string -> expected:Opium.Cookie.t -> actual:Opium.Cookie.t -> unit
check_cookie' ?msg t1 t2
checks that the cookiet1
andt2
are equal.This is a labeled variant of
check_cookie
check_body_contains
val check_body_contains : ?msg:string -> string -> Opium.Body.t -> unit Lwt.t
check_body_contains ?msg s t
checks that the bodyt
contains the strings
.