mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-06 16:18:05 +00:00
22 lines
714 B
Python
22 lines
714 B
Python
import pytest
|
|
|
|
from metadata.ingestion.source.database.databricks.metadata import format_schema_name
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"input_schema, expected_schema",
|
|
[
|
|
("test_schema-name", "`test_schema-name`"),
|
|
("test_schema_name", "test_schema_name"),
|
|
("schema-with-hyphen", "`schema-with-hyphen`"),
|
|
("schema_with_underscore", "schema_with_underscore"),
|
|
("validSchema", "validSchema"),
|
|
],
|
|
)
|
|
def test_schema_name_sanitization(input_schema, expected_schema):
|
|
"""
|
|
Test sanitization of schema names by adding backticks only around hyphenated names.
|
|
"""
|
|
sanitized_schema = format_schema_name(input_schema)
|
|
assert sanitized_schema == expected_schema
|