tests.test_pulp2_utils

Location: Pulp SmashAPI Documentationtests.test_pulp2_utils

Unit tests for pulp_smash.pulp2.utils.

class tests.test_pulp2_utils.BaseAPITestCaseTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.BaseAPITestCase.

classmethod setUpClass()

Define a child class. Call setup and teardown methods on it.

We define a child class in order to avoid altering pulp_smash.pulp2.utils.BaseAPITestCase. Calling class methods on it would do so.

test_set_up_class()

Assert method setUpClass creates correct class attributes.

Verify that the method creates attributes named cfg and resources.

test_tear_down_class()

Call method tearDownClass, and assert it deletes each resource.

pulp_smash.api.Client.delete() should be called once for each resource listed in resources, and once for pulp_smash.pulp2.constants.ORPHANS_PATH.

class tests.test_pulp2_utils.GetBrokerTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.get_broker().

test_failure()

Fail to generate a broker service management object.

Assert that pulp_smash.exceptions.NoKnownBrokerError is raised if the function cannot find a broker.

test_success()

Successfully generate a broker service management object.

Assert that:

  • get_broker(…) returns a string.
  • The cfg argument is passed to the service object.
  • The “qpidd” broker is the preferred broker.
class tests.test_pulp2_utils.PulpAdminLoginTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.pulp_admin_login().

test_run()

Assert the function executes cli.Client.run.

class tests.test_pulp2_utils.SearchUnitsTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.search_units().

test_defaults()

Verify that default parameters are correctly set.

class tests.test_pulp2_utils.SyncRepoTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.sync_repo().

test_post()

Assert the function makes an HTTP POST request.

class tests.test_pulp2_utils.UploadImportErratumTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.upload_import_erratum().

test_post()

Assert the function makes an HTTP POST request.

class tests.test_pulp2_utils.UploadImportUnitTestCase(methodName='runTest')

Test pulp_smash.pulp2.utils.upload_import_unit().

test_post()

Assert the function makes an HTTP POST request.