Example #1
0
def test_filtered_list_gen_starts_with(
        artefact_path, starts_with, x_count):
    raw_response = [{'path': artefact_path}]

    filtered_artefacts = filtered_list_gen(raw_response, starts_with)

    assert x_count == sum(1 for _ in filtered_artefacts)
Example #2
0
    def _list_raw_search(self, repository_name, path_filter, partial_match):
        # TODO: use `group` attribute in raw repositories to speed-up queries
        query = {
            'repository': repository_name,
        }

        if path_filter:
            query['keyword'] = f'"{path_filter}"'  # hacky as f**k :(

        raw_response = self._get_paginated('search/assets', params=query)

        # TODO: maybe this filter is no longer needed due to keyword use ^
        return nexus_util.filtered_list_gen(
            raw_response, term=path_filter, partial_match=partial_match)