pulp_smash.tests.rpm.api_v2.test_orphan_remove

Location: Pulp SmashAPI Documentationpulp_smash.tests.rpm.api_v2.test_orphan_remove

Test Pulp’s handling of orphaned content units.

This module integrates tightly with Pulp Fixtures. Pulp Smash #134 and Pulp Smash #459 describe specific tests that should be in this module.

class pulp_smash.tests.rpm.api_v2.test_orphan_remove.OrphansTestCase(methodName='runTest')

Establish that API calls related to orphans function correctly.

At a high level, this test case does the following:

  1. Create an RPM repository and populate it with content. Delete the repository, thus leaving behind orphans.
  2. Make several orphan-related API calls, and assert that each call has the desired effect.
check_one_orphan_deleted(orphans_pre, orphans_post, orphan)

Ensure that a specific orphan is well and truly deleted.

Parameters:
Returns:

Nothing.

classmethod setUpClass()

Create orphans.

Create, sync and delete an RPM repository. Doing this creates orphans that the test methods can make use of.

test_00_orphans_available()

Assert that an expected number of orphans is present.

If the expected number of orphans is present, set a class variable indicating such. The following test methods can conditionally run or skip based on this variable. If this method fails, it may indicate that other repositories exist and have references to the same content units.

test_01_get_by_href()

Get an orphan by its href.

test_01_get_by_invalid_type()

Get orphans by content type. Specify a non-existent content type.

test_02_delete_by_href()

Delete an orphan by its href.

test_02_delete_by_type_and_id()

Delete an orphan by its ID and type.

This test exercises Pulp #1923.

test_03_delete_by_content_type()

Delete orphans by their content type.

test_04_delete_all()

Delete all orphans.

test_05_no_orphans_exist()

Assert no orphans exist.