The ironic_python_agent.tests.functional.base Module

class ironic_python_agent.tests.functional.base.FunctionalBase(*args, **kwds)[source]

Bases: oslotest.base.BaseTestCase

request(method, path, expect_error=None, expect_json=True, **kwargs)[source]

Send a request to the agent and verifies response.

Parameters:
  • method – type of request to send as a string
  • path – desired API endpoint to request, for example ‘commands’
  • expect_error – error code to expect, if an error is expected
  • expect_json – whether to expect a JSON response. if True, convert it to a dict before returning, otherwise return the Response object
  • kwargs – keyword args to pass to the request method
Raises:

HTTPError if an error is returned that was not expected

Raises:

AssertionError if a received HTTP status code does not match expect_error

Returns:

the response object

setUp()[source]

Start the agent and wait for it to start