Skip to content
Snippets Groups Projects
Commit 4a603b0e authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

fixing CI, case insensitive DOI comparison

parent bda6e76c
Branches
Tags
No related merge requests found
Pipeline #14831 passed
"""
iPPI-DB unit tests
"""
import re
from django.core.management import call_command
......@@ -513,9 +512,18 @@ class TestGetUniprotInfo(TestCase):
{"doi": "10.1073/pnas.1110415108", "pmid": "22065758"},
{'doi': '10.7554/eLife.31012', 'pmid': '29125462'},
]
self.assertEqual(
sorted(exp_citations, key=lambda k: k["pmid"]),
sorted(resp["citations"], key=lambda k: k["pmid"]),
def to_dict(d):
return dict([(k["pmid"], k["doi"]) for k in d])
def values_ignore_case(d):
# after all case does not matter for URL and doi are URL
return dict([(k, v.lower()) for k, v in d.items()])
#also ignore the order of the key in the dict
self.assertDictEqual(
values_ignore_case(to_dict(resp["citations"])),
values_ignore_case(to_dict(exp_citations))
)
exp_alternative_names = [
{"full": "GTP-binding protein RAY"},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment