pulp_2_tests.tests.rpm.api_v2.test_search¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_search
Test Pulp’s Searching facilities.
The test cases in this module searches for content units by their type. See:
- Pulp Smash #133 asks for tests showing that it’s possible to search for content units by their type.
- The Search for Units API documentation is relevant.
-
class
pulp_2_tests.tests.rpm.api_v2.test_search.
BaseSearchTestCase
(*args, **kwargs)¶ Bases:
pulp_smash.pulp2.utils.BaseAPITestCase
Provide common functionality for the other test cases in this module.
-
static
get_feed_url
()¶ Return a repository feed URL. Used by
setUpClass()
.All child classes should override this method.
-
get_unit_by_filename
(units, filename)¶ Return the unit with the given filename.
Test methods in child classes may find this method to be of use.
Parameters: - units – An iterable of SRPM content units.
- filename – The filename of one of the content units.
Returns: The content unit with the given filename.
Raises: An assertion error if more or less than one matching unit is found.
-
classmethod
setUpClass
()¶ Create and sync a repository.
-
static
-
class
pulp_2_tests.tests.rpm.api_v2.test_search.
SearchForRpmTestCase
(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_search.BaseSearchTestCase
Search for
rpm
content units in several different ways.-
static
get_feed_url
()¶ Return an RPM repository feed URL.
-
test_include_repos
()¶ Search for all “rpm” units, and include repos in the results.
Perform the following searches. Assert a unit with filename
pulp_2_tests.constants.RPM
is in the search results, and assert it belongs to the repository created inBaseSearchTestCase.setUpClass()
.GET {'include_repos': True}
(urlencoded)POST {'criteria': {}, 'include_repos': True}
-
test_search_for_all
()¶ Search for all “rpm” units.
Perform the following searches. Assert a unit with filename
pulp_2_tests.constants.RPM
is in the search results.GET n/a POST {'criteria': {}}
-
static
-
class
pulp_2_tests.tests.rpm.api_v2.test_search.
SearchForSrpmTestCase
(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_search.BaseSearchTestCase
Search for
srpm
content units in several different ways.-
static
get_feed_url
()¶ Return an RPM repository feed URL.
-
test_include_repos
()¶ Search for all “srpm” units, and include repos in the results.
Perform the following searches. Assert a unit with filename
pulp_2_tests.constants.SRPM
is in the search results, and assert it belongs to the repository created inBaseSearchTestCase.setUpClass()
.GET {'include_repos': True}
(urlencoded)POST {'criteria': {}, 'include_repos': True}
-
test_search_for_all
()¶ Search for all “srpm” units.
Perform the following searches. Assert a unit with filename
pulp_2_tests.constants.SRPM
is in the search results.GET n/a POST {'criteria': {}}
-
static