Skip to content

Commit

Permalink
Merge pull request #4303 from inspirehep/mather-fixes
Browse files Browse the repository at this point in the history
workflows: fix reference matcher url and payload
  • Loading branch information
drjova authored Jul 19, 2023
2 parents 5cbaa80 + c99e3e5 commit 34e6110
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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

0 comments on commit 34e6110

Please sign in to comment.