mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-04 15:50:14 +00:00
27 lines
838 B
Python
27 lines
838 B
Python
from datahub.ingestion.api.common import PipelineContext
|
|
from datahub.ingestion.source.sql.cockroachdb import (
|
|
CockroachDBConfig,
|
|
CockroachDBSource,
|
|
)
|
|
from datahub.ingestion.source.sql.postgres import PostgresConfig, PostgresSource
|
|
|
|
|
|
def _base_config():
|
|
return {"username": "user", "password": "password", "host_port": "host:1521"}
|
|
|
|
|
|
def test_platform_correctly_set_cockroachdb():
|
|
source = CockroachDBSource(
|
|
ctx=PipelineContext(run_id="cockroachdb-source-test"),
|
|
config=CockroachDBConfig.parse_obj(_base_config()),
|
|
)
|
|
assert source.platform == "cockroachdb"
|
|
|
|
|
|
def test_platform_correctly_set_postgres():
|
|
source = PostgresSource(
|
|
ctx=PipelineContext(run_id="postgres-source-test"),
|
|
config=PostgresConfig.parse_obj(_base_config()),
|
|
)
|
|
assert source.platform == "postgres"
|