mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff15a7827f0>
@given(origin())
> def test_search_origin_use_ql(mocker, origin):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_archive.py:1025:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_archive.py:1041: in test_search_origin_use_ql
url_pattern=f"origin = '{origin['url']}'", use_ql=True
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
url_pattern = "origin = 'https://github.com/memononen/libtess2'", use_ql = True
limit = 50, with_visit = False, visit_types = None, page_token = None
def search_origin(
url_pattern: str,
use_ql: bool = False,
limit: int = 50,
with_visit: bool = False,
visit_types: Optional[List[str]] = None,
page_token: Optional[str] = None,
) -> Tuple[List[OriginInfo], Optional[str]]:
"""Search for origins whose urls contain a provided string pattern
or match a provided regular expression.
Args:
url_pattern: the string pattern to search for in origin urls
use_ql: whether to use swh search query language or not
limit: the maximum number of found origins to return
with_visit: Whether origins with no visit are to be filtered out
visit_types: Only origins having any of the provided visit types
(e.g. git, svn, pypi) will be returned
page_token: opaque string used to get the next results of a search
Returns:
list of origin information as dict.
"""
if page_token:
assert isinstance(page_token, str)
if search:
if config.get_config()["search_config"].get("enable_ql") and use_ql:
page_result = search.origin_search(
query=url_pattern,
page_token=page_token,
with_visit=with_visit,
visit_types=visit_types,
> limit=limit,
)
E TypeError: origin_search() got an unexpected keyword argument 'query'
.tox/py3/lib/python3.7/site-packages/swh/web/common/archive.py:332: TypeError
TEST RESULT
TEST RESULT
- Run At
- Aug 11 2021, 9:03 AM