Skip to content

Commit

Permalink
Remove missing should also remove missing srpms
Browse files Browse the repository at this point in the history
  • Loading branch information
hao-yu authored and dkliban committed Jul 8, 2020
1 parent 0e271f4 commit 3cb3120
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions plugins/pulp_rpm/plugins/importers/yum/purge.py
Expand Up @@ -104,6 +104,7 @@ def remove_missing_rpms(metadata_files, conduit, catalog):
remote_named_tuples = get_remote_units(file_function, primary.PACKAGE_TAG,
primary.process_package_element)
remove_missing_units(conduit, models.RPM, remote_named_tuples, catalog)
remove_missing_units(conduit, models.SRPM, remote_named_tuples, catalog)


def remove_missing_drpms(metadata_files, conduit, catalog):
Expand Down
13 changes: 8 additions & 5 deletions plugins/test/unit/plugins/importers/yum/test_purge.py
Expand Up @@ -63,11 +63,14 @@ def test_remove_missing_rpms(self, mock_remove, mock_get_remote_units):
mock_get_remote_units.assert_called_once_with(ANY,
primary.PACKAGE_TAG,
primary.process_package_element)
mock_remove.assert_called_once_with(
self.conduit,
models.RPM,
mock_get_remote_units.return_value,
catalog)

mock_remote_units = mock_get_remote_units.return_value
calls = [
mock.call(self.conduit, models.RPM, mock_remote_units, catalog),
mock.call(self.conduit, models.SRPM, mock_remote_units, catalog)
]
self.assertEquals(mock_remove.call_count, 2)
mock_remove.assert_has_calls(calls)

@mock.patch.object(purge, 'get_remote_units', autospec=True)
@mock.patch.object(purge, 'remove_missing_units', autospec=True)
Expand Down

0 comments on commit 3cb3120

Please sign in to comment.