Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve coverage of curie validation #284

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: improve coverage of curie validation
Issue linkml/linkml#1701 has discovered an erroneous validation of CURIE
prefixes, since apparently it doesn't accept characters '_' and '.'.

This patch extends the tests to provide test coverage for the expected
values to work, avoiding future regressions.

Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Silvanoc committed Nov 7, 2023
commit 8c722b6c7498763f5ab476172ea5d2fc0e7af77e
2 changes: 2 additions & 0 deletions tests/test_utils/test_metamodelcore.py
Original file line number Diff line number Diff line change
@@ -64,6 +64,8 @@ def test_curie(self):
self.assertFalse(Curie.is_valid("type"))
self.assertEqual(":type", Curie(":type"))
self.assertTrue(Curie.is_valid(':type'))
self.assertTrue(Curie.is_valid('WIKIDATA_PROPERTY:P854'))
self.assertTrue(Curie.is_valid('WIKIDATA.PROPERTY:P854'))
with self.assertRaises(ValueError):
Curie("1df:type")
self.assertFalse(Curie.is_valid('1df:type'))