Changeset View
Changeset View
Standalone View
Standalone View
swh/search/tests/test_api_client.py
Show All 17 Lines | class TestRemoteSearch(CommonSearchTest, ServerTestFixture, unittest.TestCase): | ||||
@pytest.fixture(autouse=True) | @pytest.fixture(autouse=True) | ||||
def _instantiate_search(self, elasticsearch_host): | def _instantiate_search(self, elasticsearch_host): | ||||
self._elasticsearch_host = elasticsearch_host | self._elasticsearch_host = elasticsearch_host | ||||
def setUp(self): | def setUp(self): | ||||
self.config = { | self.config = { | ||||
"search": { | "search": { | ||||
"cls": "elasticsearch", | "cls": "elasticsearch", | ||||
"args": {"hosts": [self._elasticsearch_host],}, | "args": {"hosts": [self._elasticsearch_host], "index_prefix": "test"}, | ||||
} | } | ||||
} | } | ||||
self.app = app | self.app = app | ||||
super().setUp() | super().setUp() | ||||
self.reset() | self.reset() | ||||
self.search = get_search("remote", url=self.url(),) | self.search = get_search("remote", url=self.url(),) | ||||
def reset(self): | def reset(self): | ||||
search = get_search("elasticsearch", hosts=[self._elasticsearch_host],) | search = get_search( | ||||
"elasticsearch", hosts=[self._elasticsearch_host], index_prefix="test" | |||||
) | |||||
search.deinitialize() | search.deinitialize() | ||||
search.initialize() | search.initialize() | ||||
@pytest.mark.skip( | @pytest.mark.skip( | ||||
"Elasticsearch also returns close matches, so this test would fail" | "Elasticsearch also returns close matches, so this test would fail" | ||||
) | ) | ||||
def test_origin_url_paging(self, count): | def test_origin_url_paging(self, count): | ||||
pass | pass |