You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/19 16:01:48 UTC

[GitHub] [superset] dpgaspar commented on a change in pull request #12594: test: presto engine spec tests

dpgaspar commented on a change in pull request #12594:
URL: https://github.com/apache/superset/pull/12594#discussion_r560276980



##########
File path: tests/db_engine_specs/presto_tests.py
##########
@@ -38,6 +40,45 @@ def test_presto_get_view_names_return_empty_list(
             [], PrestoEngineSpec.get_view_names(mock.ANY, mock.ANY, mock.ANY)
         )
 
+    @mock.patch("superset.db_engine_specs.presto.is_feature_enabled")
+    def test_get_view_names(self, mock_is_feature_enabled):
+        mock_is_feature_enabled.return_value = True
+        mock_execute = mock.MagicMock()
+        mock_fetchall = mock.MagicMock(return_value=[["a", "b,", "c"], ["d", "e"]])
+        database = 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_fetchall
+        )
+        result = PrestoEngineSpec.get_view_names(database, mock.Mock(), None)
+        mock_execute.assert_called_once_with(
+            "SELECT table_name FROM information_schema.views", {}
+        )
+        assert result == ["a", "d"]
+
+    @mock.patch("superset.db_engine_specs.presto.is_feature_enabled")
+    def test_get_view_names_with_shcema(self, mock_is_feature_enabled):

Review comment:
       typo: `test_get_view_names_with_schema`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org