tests.test_api

Location: Pulp SmashAPI Documentationtests.test_api

Unit tests for pulp_smash.api.

class tests.test_api.ClientTestCase(methodName='runTest')

Tests for pulp_smash.api.Client.

classmethod setUpClass()

Assert methods delegate to pulp_smash.api.Client.request().

All methods on pulp_smash.api.Client, such as pulp_smash.api.Client.delete(), should delegate to pulp_smash.api.Client.request(). Mock out request and call the other methods.

test_called_once()

Assert each method calls request exactly once.

test_http_action()

Assert each method calls request with the right HTTP action.

class tests.test_api.ClientTestCase2(methodName='runTest')

More tests for pulp_smash.api.Client.

test_json_arg()

Assert methods with a json argument pass on that argument.

test_response_handler()

Assert __init__ saves the response_handler argument.

The argument should be saved as an instance attribute.

class tests.test_api.CodeHandlerTestCase(methodName='runTest')

Tests for pulp_smash.api.code_handler().

test_202_check_skipped()

Assert HTTP 202 responses are not treated specially.

test_raise_for_status()

Assert response.raise_for_status() is called.

test_return()

Assert the passed-in response is returned.

class tests.test_api.EchoHandlerTestCase(methodName='runTest')

Tests for pulp_smash.api.echo_handler().

test_202_check_skipped()

Assert HTTP 202 responses are not treated specially.

test_raise_for_status()

Assert response.raise_for_status() is not called.

test_return()

Assert the passed-in response is returned.

class tests.test_api.JsonHandlerTestCase(methodName='runTest')

Tests for pulp_smash.api.json_handler().

test_202_check_run()

Assert HTTP 202 responses are treated specially.

test_204_check_run()

Assert HTTP 204 responses are treated specially.

test_raise_for_status()

Assert response.raise_for_status() is called.

test_return()

Assert the JSON-decoded body of response is returned.

class tests.test_api.PageHandlerTestCase(methodName='runTest')

Tests for pulp_smash.api.page_handler().

test_204_check_run()

Assert HTTP 204 responses are immediately returned.

test_is_a_page()

Assert paginated responses are collected.

test_not_a_page()

Assert non-paginated responses are immediately returned.

test_pulp_2_error()

Assert this handler can’t be used with Pulp 2.

class tests.test_api.SafeHandlerTestCase(methodName='runTest')

Tests for pulp_smash.api.safe_handler().

test_202_check_run()

Assert HTTP 202 responses are treated specially.

test_raise_for_status()

Assert response.raise_for_status() is called.

test_return()

Assert the passed-in response is returned.