mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-06 16:49:03 +00:00
22 lines
674 B
Python
22 lines
674 B
Python
from datahub.ingestion.source.postgres import PostgresConfig
|
|
|
|
|
|
def _base_config():
|
|
return {"username": "user", "password": "password", "host_port": "host:1521"}
|
|
|
|
|
|
def test_database_alias_takes_precendence():
|
|
config = PostgresConfig.parse_obj(
|
|
{
|
|
**_base_config(),
|
|
"database_alias": "ops_database",
|
|
"database": "postgres",
|
|
}
|
|
)
|
|
assert config.get_identifier("superset", "logs") == "ops_database.superset.logs"
|
|
|
|
|
|
def test_database_in_identifier():
|
|
config = PostgresConfig.parse_obj({**_base_config(), "database": "postgres"})
|
|
assert config.get_identifier("superset", "logs") == "postgres.superset.logs"
|