Helper Class to interact with the ApiMockServer Provides methods to
add, remove mock objects as well as incoming requests
|
__init__(self,
port)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
|
|
stop(self)
Shutdown the server and terminate process :return: |
source code
|
|
|
add_response(self,
url_filter=None,
status_code=200,
headers=None,
body='
' ,
encoding=' text ' ,
data=None)
Add the response to the mock server |
source code
|
|
|
|
|
|
|
get_responses(self)
Returns all the responses stored on the MockServer :return: |
source code
|
|
|
clear_responses(self)
Delete all the responses stored on the MockServer :return: |
source code
|
|
|
get_requests(self,
version=1)
Returns all the requests stored on the MockServer :param version: If
parameter is equal to 2, a detailed request (including headers and
body) will be returned, otherwise just the URL will be returned
:return: |
source code
|
|
|
clear_requests(self)
Delete all the requests stored on the MockServer :return: |
source code
|
|
|
host_ip(self)
Dirty hack to return the localhost IP, works only when you have an
internet connection :return: |
source code
|
|
|
_is_server_running(self)
check if the server is running and port is open |
source code
|
|
|
_wait_for_server_to_start(self)
Latency to avoid the access when the server is not started yet |
source code
|
|
|
|
Inherited from multiprocessing.process.Process :
__repr__ ,
is_alive ,
join ,
terminate
Inherited from multiprocessing.process.Process (private):
_bootstrap
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|