Skip to content

Commit b86c1fa

Browse files
committed
test: improve test coverage
Add new tests to improve test coverage. Remove also unused (and therefore not tested) functionality. Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
1 parent d9e688c commit b86c1fa

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

linkml_runtime/utils/uri_validator.py

-7
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,7 @@ def validate_uri_reference(input):
356356
return uri_validator.match(input) or uri_relative_ref_validator.match(input)
357357

358358

359-
def validate_absolute_uri(input):
360-
return abs_uri_validator.match(input)
361-
362-
363359
def validate_curie(input):
364360
# print(CURIE)
365361
return curie_validator.match(input)
366362

367-
368-
def validate_safe_curie(input):
369-
return safe_curie_validator.match(input)

tests/test_utils/test_metamodelcore.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ def test_uriorcuries(self):
4747
URIorCURIE("1:def")
4848
with self.assertRaises(ValueError):
4949
URIorCURIE(" ")
50-
#with self.assertRaises(ValueError):
51-
# URIorCURIE("_")
50+
with self.assertRaises(ValueError):
51+
URIorCURIE("[")
5252
lax()
5353
URIorCURIE("1abc:def")
5454
URIorCURIE("1:def")
55+
self.assertFalse(URIorCURIE.is_valid(123))
56+
URIorCURIE.is_curie("abc:123")
57+
self.assertFalse(URIorCURIE.is_curie("http://example.org/path"))
5558

5659
def test_curie(self):
5760
""" Test the CURIE type """

0 commit comments

Comments
 (0)