Location: Pulp SmashAPI Documentationpulp_smash.tests.pulp2.rpm.api_v2.test_unassociate

Test Unassociating Content Units from a Repository for RPM.

class pulp_smash.tests.pulp2.rpm.api_v2.test_unassociate.RemoveUnitsTestCase(methodName='runTest')

Remove units of various types from a synced repository.

do_remove_unit(type_id, repo)

Remove a content unit from the repository.

Do the following:

  1. Note the repository’s last_unit_removed field.
  2. Sleep for at least one second.
  3. Remove a unit of type type_id from the repository.
  4. Note the repository’s last_unit_removed field.

When the first unit is removed, assert that last_unit_removed changes from null to a non-null value. When each subsequent unit is removed, assert that last_unit_removed increments.

do_test(feed, type_ids)

Remove units from a repo and make assertions about it.

Do the following:

  1. Create and sync a repository with the given feed.
  2. For each type ID in type_ids, remove a content unit of that type from the repository. See do_remove_unit().
  3. Assert the correct units are still in the repository. The repository should have all the units that were originally synced into the repository, minus those that have been removed.
  4. Remove a non-existent unit from the repository. Assert that the last_unit_removed timestamp was not updated.

Get the repository’s last_unit_removed attribute.


Set variables used by each test case.


Un-associate units from a DRPM repo. See do_test().


Un-associate units from a RPM repo. See do_test().


Un-associate units from a SRPM repo. See do_test().

class pulp_smash.tests.pulp2.rpm.api_v2.test_unassociate.RepublishTestCase(*args, **kwargs)

Repeatedly publish a repository, with different content each time.

Specifically, do the following:

  1. Create a repository.
  2. Add a content unit to the repository. Publish the repository.
  3. Unassociate the content unit and repository. Publish the repository.

Verify that:

  • The last_unit_added, last_unit_removed and last_publish timestamps are correct.
  • The content unit in question is only available when associated with the repository.

Get detailed information about the repository.

classmethod setUpClass()

Create a repository.

classmethod tearDownClass()

Remove the created repository and any orphans.


Add a content unit to the repository. Publish the repository.


Search for the content unit. Assert it is available.


Unassociate the unit from the repository. Publish the repository.


Search for the content unit. Assert it isn’t available.

class pulp_smash.tests.pulp2.rpm.api_v2.test_unassociate.SelectiveAssociateTestCase(*args, **kwargs)

Ensure Pulp only associate needed content.

Test steps:

  1. Create and sync an RPM repository.
  2. Unassociate some RPMs from the repository created on the previous step.
  3. Sync the repository again and check if only the missing units were associated.

See Pulp #2457


Check if Pulp only associate missing repo content.


Maybe skip this module of tests.