michael-s-molina commented on code in PR #24983:
URL: https://github.com/apache/superset/pull/24983#discussion_r1295021817
##########
tests/integration_tests/sql_lab/api_tests.py:
##########
@@ -37,11 +37,76 @@
from superset.models.sql_lab import Query
from tests.integration_tests.base_tests import SupersetTestCase
+from tests.integration_tests.fixtures.users import create_gamma_sqllab_no_data
QUERIES_FIXTURE_COUNT = 10
class TestSqlLabApi(SupersetTestCase):
+ @pytest.mark.usefixtures("create_gamma_sqllab_no_data")
+ @mock.patch.dict(
+ "superset.extensions.feature_flag_manager._feature_flags",
+ {"SQLLAB_BACKEND_PERSISTENCE": False},
+ clear=True,
+ )
+ def test_get_from_bootstrap_data(self):
+ self.login(username="gamma_sqllab_no_data")
+ resp = self.client.get("/api/v1/sqllab/")
+ assert resp.status_code == 200
+ data = json.loads(resp.data.decode("utf-8"))
+ result = data.get("result")
+ assert result["active_tab"] == None
+ assert result["queries"] == {}
+ assert result["tab_state_ids"] == []
+ self.assertEqual(len(result["databases"]), 0)
+
+ @mock.patch.dict(
+ "superset.extensions.feature_flag_manager._feature_flags",
+ {"SQLLAB_BACKEND_PERSISTENCE": True},
+ clear=True,
+ )
+ def test_get_from_backend_persistence_payload(self):
Review Comment:
Maybe rename to `test_bootstrap_data_queries`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]