Skip to content

Commit

Permalink
Update test_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Nov 28, 2023
1 parent 81eafac commit 173b0ea
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,30 @@ def test_get_dict_from_mapping(self):
self.assertEqual(value, result_with_dict[key])

def test_curiechain_with_conflicts(self):
PREFIXMAP = {
PREFIXMAP_BOTH = {
"SCTID": "http://identifiers.org/snomedct/",
"SCTID__2": "http://snomed.info/id/",
}
PREFIXMAP_FIRST = {
"SCTID": "http://identifiers.org/snomedct/",
}
PREFIXMAP_SECOND = {
"SCTID__2": "http://snomed.info/id/",
}

EPM = [
{
"prefix": "SCTID",
"prefix_synonyms": ["snomed"],
"uri_prefix": "http://snomed.info/id/",
},

]

conv = chain([Converter.from_prefix_map(PREFIXMAP), Converter.from_extended_prefix_map(EPM)])
self.assertIn("SCTID__2",conv.bimap)
converter = chain([Converter.from_prefix_map(PREFIXMAP_FIRST), Converter.from_extended_prefix_map(EPM)])
self.assertIn("SCTID", converter.prefix_map)
converter = chain([Converter.from_prefix_map(PREFIXMAP_SECOND), Converter.from_extended_prefix_map(EPM)])
self.assertIn("SCTID", converter.prefix_map)
# Fails here:
converter = chain([Converter.from_prefix_map(PREFIXMAP_BOTH), Converter.from_extended_prefix_map(EPM)])
self.assertIn("SCTID", converter.prefix_map)

0 comments on commit 173b0ea

Please sign in to comment.