<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="MockServerLibrary" type="library" format="ROBOT" generated="20200529 11:04:03">
<version>0.0.6</version>
<scope>global</scope>
<namedargs>yes</namedargs>
<doc>Robot Framework library for interacting with [http://www.mock-server.com|MockServer]

The purpose of this library is to provide a keyword-based API
towards MockServer to be used in robot tests. The project is hosted in
[https://github.com/etsi-cti-admin/robotframework-mockserver|GitHub],
and packages are released to PyPI.

= Installation =

| pip install robotframework-mockserver

= Importing =

The library does not currently support any import arguments, so use the
following setting to take the library into use:

| Library | MockServerLibrary |</doc>
<kw name="Clear Requests">
<arguments>
<arg>path</arg>
</arguments>
<doc>Clears expectations and requests for a specific endpoint from the mockserver.

`path` is the url of the endpoint for which to clean expectations and requests, e.g. /api</doc>
<tags>
</tags>
</kw>
<kw name="Create Default Mock Expectation">
<arguments>
<arg>method</arg>
<arg>path</arg>
<arg>response_code=200</arg>
<arg>response_headers=None</arg>
<arg>body_type=JSON</arg>
<arg>response_body=None</arg>
</arguments>
<doc>Creates a default expectation to be used by mockserver.

`method` is the HTTP method of the mocked endpoint

`path` is the url of the mocked endpoint, e.g. /api

`response_code` is the HTTP status code of the response

`response_headers` is a dictionary of headers to be added to the response

`body_type` is the type of the response body, e.g. JSON

`response_body` is a dictonary of JSON attribute(s) to be added to the response body</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Expectation">
<arguments>
<arg>request</arg>
<arg>response</arg>
<arg>count=1</arg>
<arg>unlimited=True</arg>
</arguments>
<doc>Creates a mock expectation to be used by mockserver.

`request` is a mock request matcher in a dictionary format.

`response` is a mock response in a dictionary format.

`count` is the number of expected requests

`unlimited` is a boolean value which, if enabled, allows unspecified number of
requests to reply to</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Expectation With Data">
<arguments>
<arg>data</arg>
</arguments>
<doc>Creates a mock expectation with defined data to be used by mockserver.

`data` is a dictionary or JSON string with mock data. Please see
[https://app.swaggerhub.com/apis/jamesdbloom/mock-server_api|MockServer documentation]
for the detailed API reference.</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Expectation With Http Forward">
<arguments>
<arg>request</arg>
<arg>forward</arg>
<arg>count=1</arg>
<arg>unlimited=True</arg>
</arguments>
<doc>Creates a mock expectation with request and forward action to be used by mockserver.

`request` is a mock request matcher in a dictionary format.

`forward` is a mock forward in a dictionary format.

`count` is the number of expected requests

`unlimited` is a boolean value which, if enabled, allows unspecified number of
requests to reply to</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Http Forward">
<arguments>
<arg>path</arg>
<arg>delay=1</arg>
<arg>unit=SECONDS</arg>
</arguments>
<doc>Creates a mock http override forward to be used by mockserver.

Returns the http forward in a dictionary format.

`path` is the new url where to forward the request

`delay` is the delay of the forward action

`unit` is the unit of the delay time (default "SECONDS")</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Request Matcher">
<arguments>
<arg>method</arg>
<arg>path</arg>
<arg>body_type=JSON</arg>
<arg>body=None</arg>
<arg>exact=True</arg>
</arguments>
<doc>Creates a mock request matcher to be used by mockserver.

Returns the request matcher in a dictionary format.

`method` is the HTTP method of the mocked endpoint

`path` is the url of the mocked endpoint, e.g. /api

`body_type` is the type of the request body, e.g. JSON

`body` is a dictionary of the json attribute(s) to match

`exact` is a boolean value which specifies whether the body should match fully (=true),
or if only specified fields should match (=false)</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Response">
<arguments>
<arg>status_code</arg>
<arg>headers=None</arg>
<arg>body_type=JSON</arg>
<arg>body=None</arg>
</arguments>
<doc>Creates a mock response to be used by mockserver.

Returns the response in a dictionary format.

`status_code` is the HTTP status code of the response

`headers` is a dictionary of headers to be added to the response

`body_type` is the type of the response body, e.g. JSON

`body` is a dictonary of JSON attribute(s) to be added to the response body</doc>
<tags>
</tags>
</kw>
<kw name="Create Mock Session">
<arguments>
<arg>base_url</arg>
</arguments>
<doc>Creates an HTTP session towards mockserver.

`base_url` is the full url (including port, if applicable) of the mockserver,
e.g. http://localhost:1080.</doc>
<tags>
</tags>
</kw>
<kw name="Dump To Log">
<arguments>
</arguments>
<doc>Dumps logs at the mockserver.</doc>
<tags>
</tags>
</kw>
<kw name="Reset All Requests">
<arguments>
</arguments>
<doc>Clears all expectations and received requests from the mockserver.</doc>
<tags>
</tags>
</kw>
<kw name="Retrieve Expectations">
<arguments>
<arg>path</arg>
</arguments>
<doc>Retrieves expectations from the mockserver.

`path` is the url of the endpoint for which to retrieve expectations, e.g. /api</doc>
<tags>
</tags>
</kw>
<kw name="Retrieve Requests">
<arguments>
<arg>path</arg>
</arguments>
<doc>Retrieves requests from the mockserver

`path` is the url of the endpoint for which to retrieve requests, e.g. /api</doc>
<tags>
</tags>
</kw>
<kw name="Verify Mock Expectation">
<arguments>
<arg>request</arg>
<arg>count=1</arg>
<arg>exact=True</arg>
</arguments>
<doc>Verifies that the mockserver has received a specific request.

`request` is a request expectation created using the keyword `Create Mock Request Matcher`

`count` is the minimum expected number of requests

`exact` specifies whether the expected count should match the actual received count</doc>
<tags>
</tags>
</kw>
<kw name="Verify Mock Expectation With Data">
<arguments>
<arg>data</arg>
</arguments>
<doc>Verifies a mock expectation with specified data.

`data` is a dictionary or JSON string with mock data. Please see
[https://app.swaggerhub.com/apis/jamesdbloom/mock-server_api|MockServer documentation]
for the detailed API reference.</doc>
<tags>
</tags>
</kw>
<kw name="Verify Mock Sequence">
<arguments>
<arg>requests</arg>
</arguments>
<doc>Verifies that the mockserver has received a specific ordered request sequence.

`requests` is a list of request expectations created using the keyword
`Create Mock Request Matcher`</doc>
<tags>
</tags>
</kw>
</keywordspec>
