Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Feb 1, 2021
1 parent 5f67c77 commit 1246a5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/pyobo/struct/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,11 @@ def from_obonet(cls, graph: nx.MultiDiGraph) -> 'Obo':
e.reference = reference
raise e
xrefs, provenance = [], []
for reference in node_xrefs:
if reference.prefix in PROVENANCE_PREFIXES:
provenance.append(reference)
for node_xref in node_xrefs:
if node_xref.prefix in PROVENANCE_PREFIXES:
provenance.append(node_xref)
else:
xrefs.append(reference)
xrefs.append(node_xref)

try:
alt_ids = list(iterate_node_alt_ids(data))
Expand Down
3 changes: 2 additions & 1 deletion tests/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,6 @@ def test_get_id_alts_mapping(self):
alt_id: CHEBI:14384
"""
id_alts_mapping = self.obo.get_id_alts_mapping()
self.assertIn('16042', id_alts_mapping)
self.assertNotIn('C00462', id_alts_mapping)
self.assertIn('16042', id_alts_mapping, msg='halide anion alt_id fields not parsed')
self.assertEqual({'5605', '14384'}, set(id_alts_mapping['16042']))

0 comments on commit 1246a5d

Please sign in to comment.