diff --git a/dbt-athena/tests/unit/test_adapter.py b/dbt-athena/tests/unit/test_adapter.py index e3c3b923..291979fd 100644 --- a/dbt-athena/tests/unit/test_adapter.py +++ b/dbt-athena/tests/unit/test_adapter.py @@ -12,6 +12,7 @@ from dbt_common.exceptions import ConnectionError, DbtRuntimeError from moto import mock_aws from moto.core import DEFAULT_ACCOUNT_ID +from mypy_boto3_glue.client import GlueClient from dbt.adapters.athena import AthenaAdapter from dbt.adapters.athena import Plugin as AthenaPlugin @@ -1252,6 +1253,17 @@ def test_format_unsupported_type(self): with pytest.raises(ValueError): self.adapter.format_value_for_partition("test", "unsupported_type") + @mock_aws + def test_drop_glue_database(self, mock_aws_service): + glue_client: GlueClient = boto3.client("glue", region_name=AWS_REGION) + test_input = {"Name": "test"} + glue_client.create_database(DatabaseInput=test_input) + database_list = glue_client.get_databases()["DatabaseList"] + assert [test_input["Name"]] == [db["Name"] for db in database_list] + self.adapter.acquire_connection("dummy") + self.adapter.drop_glue_database(database_name=test_input["Name"]) + assert glue_client.get_databases()["DatabaseList"] == [] + class TestAthenaFilterCatalog: def test__catalog_filter_table(self):