Skip to content

Commit

Permalink
Merge pull request #164 from linkml/issue_163
Browse files Browse the repository at this point in the history
Fix issue #163
  • Loading branch information
hsolbrig committed Apr 15, 2022
2 parents b75feaa + d62df9f commit 0c2d6e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion linkml_runtime/utils/context_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def parse_import_map(map_: Optional[Union[str, Dict[str, str], TextIOWrapper]],
if ':' not in v:
v = os.path.join(base, v)
if ':/' not in v:
v = os.path.abspath(v)
v = os.path.abspath(v) + (os.sep if v.endswith(os.sep) else '')
outmap[k] = v
rval = outmap
return rval
16 changes: 16 additions & 0 deletions tests/test_issues/test_issue_163.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import unittest

from linkml_runtime.utils.context_utils import parse_import_map


class Issue163TestCase(unittest.TestCase):
def test_trailing_sep(self):
""" Test the importmap namespace """
importmap = parse_import_map('{ "base:": "base/" }', os.path.dirname(__file__))
# TODO: see how this works in a windows environment
self.assertTrue(importmap['base:'].endswith('/'), msg="Trailing separator stripped in import map parsing")


if __name__ == '__main__':
unittest.main()

0 comments on commit 0c2d6e2

Please sign in to comment.