File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1213,6 +1213,9 @@ def get_uri(
12131213 elif isinstance (e , SlotDefinition ):
12141214 uri = e .slot_uri
12151215 e_name = underscore (e .name )
1216+ elif isinstance (e , EnumDefinition ):
1217+ uri = e .enum_uri
1218+ e_name = e .name
12161219 elif isinstance (e , TypeDefinition ):
12171220 uri = e .uri
12181221 e_name = underscore (e .name )
Original file line number Diff line number Diff line change @@ -640,6 +640,9 @@ def test_imports(schema_view_with_imports: SchemaView) -> None:
640640 assert view .get_uri ("TestClass" , use_element_type = True ) == "core:class/TestClass"
641641 assert view .get_uri ("name" , use_element_type = True ) == "core:slot/name"
642642
643+ assert view .get_uri ("OrganismType" ) == "ks:OrganismType"
644+ assert view .get_uri ("OrganismType" , use_element_type = True ) == "ks:enum/OrganismType"
645+
643646 assert view .get_uri ("string" ) == "xsd:string"
644647
645648 # dynamic enums
@@ -1263,9 +1266,11 @@ def test_uris_without_default_prefix() -> None:
12631266 view = SchemaView (schema_definition )
12641267 view .add_class (ClassDefinition (name = "TestClass" , from_schema = "https://example.org/another#" ))
12651268 view .add_slot (SlotDefinition (name = "test_slot" , from_schema = "https://example.org/another#" ))
1269+ view .add_enum (EnumDefinition (name = "tEsT_enum" , from_schema = "https://example.org/another#" ))
12661270
12671271 assert view .get_uri ("TestClass" , imports = True ) == "https://example.org/test#TestClass"
12681272 assert view .get_uri ("test_slot" , imports = True ) == "https://example.org/test#test_slot"
1273+ assert view .get_uri ("tEsT_enum" , imports = True ) == "https://example.org/test#tEsT_enum"
12691274
12701275
12711276"""
You can’t perform that action at this time.
0 commit comments