2021-07-14 20:02:48 -07:00
|
|
|
import pytest
|
2021-06-09 15:12:17 -07:00
|
|
|
|
|
|
|
|
2021-07-14 20:02:48 -07:00
|
|
|
@pytest.mark.integration
|
|
|
|
def test_hive_configuration_get_identifier_with_database():
|
2021-07-26 13:06:52 -07:00
|
|
|
from datahub.ingestion.source.sql.hive import HiveConfig
|
2021-06-09 15:12:17 -07:00
|
|
|
|
2021-07-14 20:02:48 -07:00
|
|
|
test_db_name = "test_database"
|
|
|
|
test_schema_name = "test_schema"
|
|
|
|
test_table_name = "test_table"
|
|
|
|
config_dict = {
|
|
|
|
"username": "test",
|
|
|
|
"password": "test",
|
|
|
|
"host_port": "test:80",
|
|
|
|
"database": test_db_name,
|
|
|
|
"scheme": "hive+https",
|
|
|
|
}
|
|
|
|
hive_config = HiveConfig.parse_obj(config_dict)
|
|
|
|
expected_output = f"{test_db_name}.{test_schema_name}.{test_table_name}"
|
|
|
|
output = hive_config.get_identifier(schema=test_schema_name, table=test_table_name)
|
|
|
|
assert output == expected_output
|