test adjusted
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from inse.model import ESIndex
|
||||
from inse.patents.elastic_search_client import (
|
||||
DEFAULT_SEARCH_SIZE,
|
||||
EPO_INDEX,
|
||||
PatentSearchClient,
|
||||
USPTO_INDEX,
|
||||
)
|
||||
|
||||
|
||||
@@ -28,15 +26,15 @@ def test_epo_query_uses_nested_search_and_name_variants():
|
||||
|
||||
|
||||
def test_uspto_index_is_3_0():
|
||||
assert USPTO_INDEX == "uspto_patents_3.0"
|
||||
assert EPO_INDEX == "epo_index_1.0"
|
||||
assert ESIndex.USPTO_INDEX == "uspto_patents_3.0"
|
||||
assert ESIndex.EPO_INDEX == "epo_index_1.0"
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_search_epo_posts_to_correct_index():
|
||||
captured: list[dict] = []
|
||||
|
||||
def fake_search(index: str, body: dict):
|
||||
def fake_search(index: str, body: dict, cluster=None):
|
||||
captured.append({"index": index, "body": body})
|
||||
return {"hits": {"hits": []}}
|
||||
|
||||
@@ -45,4 +43,4 @@ async def test_search_epo_posts_to_correct_index():
|
||||
await client.search_epo(client.epo_query_by_inventor("Weber", "Christian"))
|
||||
|
||||
assert len(captured) == 1
|
||||
assert captured[0]["index"] == EPO_INDEX
|
||||
assert captured[0]["index"] == ESIndex.EPO_INDEX
|
||||
Reference in New Issue
Block a user