Bases: oslotest.base.BaseTestCase
Send a request to the agent and verifies response.
Param: | method type of request to send as a string |
---|---|
Param: | path desired API endpoint to request, for example ‘commands’ |
Param: | expect_error error code to expect, if an error is expected |
Param: | expect_json whether to expect a JSON response. if True, convert it to a dict before returning, otherwise return the Response object |
Parameters: | **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 |