api_client = <rest_framework.test.APIClient object at 0x7f26c7e2dd68>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f26c701c828>
backend = 'swh-search'
@pytest.mark.parametrize("backend", ["swh-search", "swh-indexer-storage"])
def test_api_origin_metadata_search(api_client, mocker, backend):
mock_config = mocker.patch("swh.web.common.archive.config")
mock_config.get_config.return_value = {"metadata_search_backend": backend}
url = reverse(
"api-1-origin-metadata-search", query_params={"fulltext": ORIGIN_METADATA_VALUE}
)
rv = check_api_get_responses(api_client, url, status_code=200)
expected_data = [
{
"url": origin_url,
"metadata": {
"from_revision": master_rev,
"tool": {
"name": INDEXER_TOOL["tool_name"],
"version": INDEXER_TOOL["tool_version"],
"configuration": INDEXER_TOOL["tool_configuration"],
"id": INDEXER_TOOL["id"],
},
"metadata": {ORIGIN_METADATA_KEY: ORIGIN_METADATA_VALUE},
"mappings": [],
},
}
for origin_url, master_rev in ORIGIN_MASTER_REVISION.items()
]
> assert rv.data == expected_data
E AssertionError: assert [{'metadata':..._submodules'}] == [{'metadata':..._submodules'}]
E At index 1 diff: {'url': 'https://github.com/wcoder/highlightjs-line-numbers.js', 'metadata': {'tool': {'id': -5385064995634461458, 'name': 'swh-web tests', 'version': '1.0', 'configuration': {}}, 'metadata': {'vcs': 'git', 'description': 'Line numbering plugin for Highlight.js'}, 'from_revision': '3bd01955e961aa2e6e1b6f9cd9e003f94273584e', 'mappings': []}} != {'url': 'https://github.com/wcoder/highlightjs-line-numbers.js', 'metadata': {'from_revision': '3bd01955e961aa2e6e1b6f9cd9e003f94273584e', 'tool': {'name': 'swh-web tests', 'version': '1.0', 'configuration': {}, '...
E
E ...Full output truncated (33 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_origin.py:625: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 27 2021, 7:10 PM