diff --git a/tests/integration_tests/db_engine_specs/presto_tests.py b/tests/integration_tests/db_engine_specs/presto_tests.py index 4a76d59a46faf..100a9586fb46e 100644 --- a/tests/integration_tests/db_engine_specs/presto_tests.py +++ b/tests/integration_tests/db_engine_specs/presto_tests.py @@ -79,6 +79,27 @@ def test_get_view_names_without_schema(self): ) assert result == {"a", "d"} + def test_get_view_names_without_schema(self): + database = mock.MagicMock() + mock_execute = mock.MagicMock() + database.get_sqla_engine.return_value.raw_connection.return_value.cursor.return_value.execute = ( + mock_execute + ) + database.get_sqla_engine.return_value.raw_connection.return_value.cursor.return_value.fetchall = mock.MagicMock( + return_value=[["a", "b,", "c"], ["d", "e"]] + ) + result = PrestoEngineSpec.get_view_names(database, mock.Mock(), None) + mock_execute.assert_called_once_with( + dedent( + """ + SELECT table_name FROM information_schema.tables + WHERE table_type = 'VIEW' + """ + ).strip(), + {}, + ) + assert result == ["a", "d"] + def verify_presto_column(self, column, expected_results): inspector = mock.Mock() inspector.engine.dialect.identifier_preparer.quote_identifier = mock.Mock()