Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: fix reference matcher url and payload #4303

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inspirehep/modules/workflows/tasks/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,11 @@ def match_references_hep(references):
data = {'references': references}
inspirehep_url = current_app.config.get("INSPIREHEP_URL")
response = requests.post(
"{inspirehep_url}/api/matcher/linked_references/".format(
"{inspirehep_url}/matcher/linked_references/".format(
inspirehep_url=inspirehep_url,
),
headers=headers,
json=json.dumps(data)
json=data
)
if response.status_code == 200:
return response.json()['references']
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/workflows/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def mocked_external_services(workflow_app):
)
requests_mocker.register_uri(
"POST",
"{}/api/matcher/linked_references/".format(
"{}/matcher/linked_references/".format(
workflow_app.config["INSPIREHEP_URL"]
),
json={
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_async/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def test_wf_replaces_old_workflow_which_is_in_halted_state(
)
request_mocker.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={
"references": [
{
Expand Down Expand Up @@ -407,7 +407,7 @@ def test_wf_rejects_automatically_when_previous_matched_wf_was_rejected(
)
request_mocker.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={
"references": [
{
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/workflows/test_workflows_tasks_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ def test_refextract_from_text(mock_match, mock_get_document_in_workflow, mock_cr
)
mock_request.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={"references": [{"raw_refs": [{"source": "submitter"}]}]},
status_code=200,
)
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def test_refextract_from_raw_refs(mock_create_journal_dict, mock_match):
)
mock_request.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={
"references": [
{
Expand Down Expand Up @@ -1382,7 +1382,7 @@ def test_refextract_valid_refs_from_raw_refs(mock_create_journal_dict, mock_matc
)
mock_request.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={"references": [{"raw_refs": [{"source": "submitter"}]}]},
status_code=200,
)
Expand Down Expand Up @@ -1432,7 +1432,7 @@ def test_refextract_valid_refs_from_text(mock_get_document_in_workflow, mock_cre
)
mock_request.register_uri(
"POST",
"http://web:8000/api/matcher/linked_references/",
"http://web:8000/matcher/linked_references/",
json={"references": [{"raw_refs": [{"source": "submitter", "value": "M.R"}]}]},
status_code=200,
)
Expand Down
Loading