datahub/metadata-ingestion/tests/unit/test_hive_source.py

24 lines
799 B
Python
Raw Normal View History

import unittest
from datahub.ingestion.source.hive import HiveConfig
class HiveSinkTest(unittest.TestCase):
def test_hive_configuration_get_indentifier_with_database(self):
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