The ironic_python_agent.tests.unit.test_api
Module¶
-
class
ironic_python_agent.tests.unit.test_api.
TestIronicAPI
(*args, **kwds)[source]¶ Bases:
oslotest.base.BaseTestCase
-
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
-
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
-