1
1
import pytest
2
- from pathlib import Path
3
- from linkml_runtime .linkml_model import SchemaDefinition , ClassDefinition , SlotDefinition , EnumDefinition
2
+ from linkml_runtime .linkml_model import SchemaDefinition
4
3
from schema_automator .importers .dbml_import_engine import DbmlImportEngine
5
4
6
5
# Sample DBML content for testing
@@ -60,20 +59,6 @@ def test_dbml_to_linkml_conversion(dbml_file, importer):
60
59
assert schema .slots ["id" ].required
61
60
62
61
63
- def test_controlled_vocabulary_detection (dbml_file , importer ):
64
- """
65
- Test that controlled vocabulary tables are converted to enumerations.
66
- """
67
- schema = importer .convert (file = str (dbml_file ), name = "TestSchema" )
68
-
69
- # Assert the enum is created for Countries
70
- assert "Countries" in schema .enums
71
-
72
- # Check the enum details
73
- countries_enum = schema .enums ["Countries" ]
74
- assert isinstance (countries_enum , EnumDefinition )
75
- assert "code" in countries_enum .permissible_values
76
-
77
62
def test_primary_key_handling (dbml_file , importer ):
78
63
"""
79
64
Test correct handling of primary keys and required attributes.
@@ -85,13 +70,3 @@ def test_primary_key_handling(dbml_file, importer):
85
70
assert "id" in users_class .slots
86
71
assert schema .slots ["id" ].identifier
87
72
assert schema .slots ["id" ].required
88
-
89
- def test_multi_column_unique_key_handling (dbml_file , importer ):
90
- """
91
- Test correct handling of multi-column unique keys.
92
- """
93
- schema = importer .convert (file = str (dbml_file ), name = "TestSchema" )
94
-
95
- # Check multi-column unique keys in Orders
96
- orders_class = schema .classes ["Orders" ]
97
- assert orders_class .unique_keys == [["order_id" , "user_id" ]]
0 commit comments