The ironic.tests.unit.api.base Module¶
Base classes for API tests.
- 
class 
ironic.tests.unit.api.base.BaseApiTest(*args, **kwargs)[source]¶ Bases:
ironic.tests.unit.db.base.DbTestCasePecan controller functional testing class.
Used for functional tests of Pecan controllers where you need to test your literal application and its integration with the framework.
- 
delete(path, expect_errors=False, headers=None, extra_environ=None, status=None, path_prefix=’/v1’)[source]¶ Sends simulated HTTP DELETE request to Pecan test app.
Parameters: - path – url path of target service
 - expect_errors – Boolean value; whether an error is expected based on request
 - headers – a dictionary of headers to send along with the request
 - extra_environ – a dictionary of environ variables to send along with the request
 - status – expected status code of response
 - path_prefix – prefix of the url path
 
- 
get_json(path, expect_errors=False, headers=None, extra_environ=None, q=None, path_prefix=’/v1’, **params)[source]¶ Sends simulated HTTP GET request to Pecan test app.
Parameters: - path – url path of target service
 - expect_errors – Boolean value;whether an error is expected based on request
 - headers – a dictionary of headers to send along with the request
 - extra_environ – a dictionary of environ variables to send along with the request
 - q – list of queries consisting of: field, value, op, and type keys
 - path_prefix – prefix of the url path
 - params – content for wsgi.input of request
 
- 
patch_json(path, params, expect_errors=False, headers=None, extra_environ=None, status=None)[source]¶ Sends simulated HTTP PATCH request to Pecan test app.
Parameters: - path – url path of target service
 - params – content for wsgi.input of request
 - expect_errors – Boolean value; whether an error is expected based on request
 - headers – a dictionary of headers to send along with the request
 - extra_environ – a dictionary of environ variables to send along with the request
 - status – expected status code of response
 
- 
post_json(path, params, expect_errors=False, headers=None, extra_environ=None, status=None)[source]¶ Sends simulated HTTP POST request to Pecan test app.
Parameters: - path – url path of target service
 - params – content for wsgi.input of request
 - expect_errors – Boolean value; whether an error is expected based on request
 - headers – a dictionary of headers to send along with the request
 - extra_environ – a dictionary of environ variables to send along with the request
 - status – expected status code of response
 
- 
put_json(path, params, expect_errors=False, headers=None, extra_environ=None, status=None)[source]¶ Sends simulated HTTP PUT request to Pecan test app.
Parameters: - path – url path of target service
 - params – content for wsgi.input of request
 - expect_errors – Boolean value; whether an error is expected based on request
 - headers – a dictionary of headers to send along with the request
 - extra_environ – a dictionary of environ variables to send along with the request
 - status – expected status code of response
 
-