def test_adjust_database_uri_when_selected_schema_is_none(self): url = URL(drivername="trino", database="hive") TrinoEngineSpec.adjust_database_uri(url, selected_schema=None) self.assertEqual(url.database, "hive") url.database = "hive/default" TrinoEngineSpec.adjust_database_uri(url, selected_schema=None) self.assertEqual(url.database, "hive/default")
def test_adjust_database_uri_when_database_contain_schema(self): url = URL(drivername="trino", database="hive/default") TrinoEngineSpec.adjust_database_uri(url, selected_schema="foobar") self.assertEqual(url.database, "hive/foobar")