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
setUp()[source]
tearDown()[source]
test_execute_agent_command_params_validation()[source]
test_execute_agent_command_success_no_wait()[source]
test_execute_agent_command_success_with_false_wait()[source]
test_execute_agent_command_success_with_true_wait()[source]
test_execute_agent_command_validation()[source]
test_get_agent_status()[source]
test_get_command_result()[source]
test_list_command_results()[source]
test_root()[source]
test_v1_root()[source]