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.


Assert method setUpClass creates correct class attributes.

Verify that the method creates attributes named cfg and resources.


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().


Fail to generate a broker service management object.

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


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().


Assert the function executes cli.Client.run.

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

Test pulp_smash.pulp2.utils.search_units().


Verify that default parameters are correctly set.

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

Test pulp_smash.pulp2.utils.sync_repo().


Assert the function makes an HTTP POST request.

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

Test pulp_smash.pulp2.utils.upload_import_erratum().


Assert the function makes an HTTP POST request.

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

Test pulp_smash.pulp2.utils.upload_import_unit().


Assert the function makes an HTTP POST request.