Skip to content

Commit

Permalink
removing test_task_match_claim_warning_cl_status_code_not_200_should_…
Browse files Browse the repository at this point in the history
…return_verified
  • Loading branch information
femalves committed Jul 21, 2023
1 parent 089a2b2 commit 9e764d1
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions ADSOrcid/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,44 +470,44 @@ def test_task_match_claim_no_cl_should_not_call_record_claims(self):
# self.assertIn("0000-0003-3041-2092", warning_args[0][0])
# self.assertIn("rejected", warning_args[0][0])

def test_task_match_claim_warning_cl_status_code_not_200_should_return_verified(
self,
):
with patch("logging.Logger.warning") as mock_warning, patch.object(
tasks.app.client, "post"
) as post:
r = PropertyMock()
data = {"BIBCODE22": "status"}
r.text = str(data)
r.json = lambda: data
r.status_code = 404
post.return_value = r
# def test_task_match_claim_warning_cl_status_code_not_200_should_return_verified(
# self,
# ):
# with patch("logging.Logger.warning") as mock_warning, patch.object(
# tasks.app.client, "post"
# ) as post:
# r = PropertyMock()
# data = {"BIBCODE22": "status"}
# r.text = str(data)
# r.json = lambda: data
# r.status_code = 404
# post.return_value = r

tasks.task_match_claim(
claim={
"status": "claimed",
"bibcode": "BIBCODE22",
"name": "Stern, D K",
"provenance": "provenance",
"identifiers": ["id1", "id2"],
"orcid_name": ["Stern, Daniel"],
"author_norm": ["Stern, D"],
"author_status": None,
"orcidid": "0000-0003-3041-2092",
"author": ["Stern, D", "Stern, D K", "Stern, Daniel"],
"author_id": 1,
"account_id": None,
"author_list": ["Stern, D K", "author two"],
}
)
# tasks.task_match_claim(
# claim={
# "status": "claimed",
# "bibcode": "BIBCODE22",
# "name": "Stern, D K",
# "provenance": "provenance",
# "identifiers": ["id1", "id2"],
# "orcid_name": ["Stern, Daniel"],
# "author_norm": ["Stern, D"],
# "author_status": None,
# "orcidid": "0000-0003-3041-2092",
# "author": ["Stern, D", "Stern, D K", "Stern, Daniel"],
# "author_id": 1,
# "account_id": None,
# "author_list": ["Stern, D K", "author two"],
# }
# )

warning_args = mock_warning.call_args
# warning_args = mock_warning.call_args

self.assertIn("id1", warning_args[0][0])
self.assertIn("id2", warning_args[0][0])
self.assertIn("BIBCODE22", warning_args[0][0])
self.assertIn("0000-0003-3041-2092", warning_args[0][0])
self.assertIn("verified", warning_args[0][0])
# self.assertIn("id1", warning_args[0][0])
# self.assertIn("id2", warning_args[0][0])
# self.assertIn("BIBCODE22", warning_args[0][0])
# self.assertIn("0000-0003-3041-2092", warning_args[0][0])
# self.assertIn("verified", warning_args[0][0])

def test_task_match_claim_warning_cl_bibcode_length_is_different_should_return_does_not_match(
self,
Expand Down

0 comments on commit 9e764d1

Please sign in to comment.