Skip to content

Commit 3faf3b3

Browse files
authored
Test prefix maps using bioregistry's epm as reference. (#406)
Drafted with @matentzn over a call.
1 parent 52e2dbd commit 3faf3b3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_prefixes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Test for built-in prefixes."""
2+
3+
import unittest
4+
5+
from sssom.context import get_extended_prefix_map, get_jsonld_context
6+
7+
8+
class TestPrefix(unittest.TestCase):
9+
"""A test case for testing prefixes using EPM."""
10+
11+
def test_builtin_prefixes(self):
12+
"""This test ensures that the bioregistry managed EPM (extended prefix-map) does not deviate from the fixed SSSOM built-in prefixes."""
13+
prefix_map = get_extended_prefix_map()
14+
sssom_schema_context = get_jsonld_context()
15+
for k, v in prefix_map.items():
16+
if isinstance(v, str):
17+
if k in sssom_schema_context["@context"]:
18+
self.assertTrue(sssom_schema_context["@context"][k] == v)

0 commit comments

Comments
 (0)