mirror of
https://github.com/apache/superset.git
synced 2026-04-08 02:45:22 +00:00
chore(command): Organize Commands according to SIP-92 (#25850)
This commit is contained in:
@@ -209,7 +209,7 @@ class TestSqlLabApi(SupersetTestCase):
|
||||
return_value=formatter_response
|
||||
)
|
||||
|
||||
with mock.patch("superset.sqllab.commands.estimate.db") as mock_superset_db:
|
||||
with mock.patch("superset.commands.sql_lab.estimate.db") as mock_superset_db:
|
||||
mock_superset_db.session.query().get.return_value = db_mock
|
||||
|
||||
data = {"database_id": 1, "sql": "SELECT 1"}
|
||||
@@ -236,7 +236,7 @@ class TestSqlLabApi(SupersetTestCase):
|
||||
self.assertDictEqual(resp_data, success_resp)
|
||||
self.assertEqual(rv.status_code, 200)
|
||||
|
||||
@mock.patch("superset.sqllab.commands.results.results_backend_use_msgpack", False)
|
||||
@mock.patch("superset.commands.sql_lab.results.results_backend_use_msgpack", False)
|
||||
def test_execute_required_params(self):
|
||||
self.login()
|
||||
client_id = f"{random.getrandbits(64)}"[:10]
|
||||
@@ -276,7 +276,7 @@ class TestSqlLabApi(SupersetTestCase):
|
||||
self.assertDictEqual(resp_data, failed_resp)
|
||||
self.assertEqual(rv.status_code, 400)
|
||||
|
||||
@mock.patch("superset.sqllab.commands.results.results_backend_use_msgpack", False)
|
||||
@mock.patch("superset.commands.sql_lab.results.results_backend_use_msgpack", False)
|
||||
def test_execute_valid_request(self) -> None:
|
||||
from superset import sql_lab as core
|
||||
|
||||
@@ -320,9 +320,9 @@ class TestSqlLabApi(SupersetTestCase):
|
||||
|
||||
self.delete_fake_db_for_macros()
|
||||
|
||||
@mock.patch("superset.sqllab.commands.results.results_backend_use_msgpack", False)
|
||||
@mock.patch("superset.commands.sql_lab.results.results_backend_use_msgpack", False)
|
||||
def test_get_results_with_display_limit(self):
|
||||
from superset.sqllab.commands import results as command
|
||||
from superset.commands.sql_lab import results as command
|
||||
|
||||
command.results_backend = mock.Mock()
|
||||
self.login()
|
||||
@@ -355,7 +355,7 @@ class TestSqlLabApi(SupersetTestCase):
|
||||
compressed = utils.zlib_compress(serialized_payload)
|
||||
command.results_backend.get.return_value = compressed
|
||||
|
||||
with mock.patch("superset.sqllab.commands.results.db") as mock_superset_db:
|
||||
with mock.patch("superset.commands.sql_lab.results.db") as mock_superset_db:
|
||||
mock_superset_db.session.query().filter_by().one_or_none.return_value = (
|
||||
query_mock
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user