init
This commit is contained in:
1 parent
c7fccf99c7
commit
8471f368eb
33 files changed
+444
-2095
No files matched your search
@@ -177,28 +177,6 @@ class TestShowGrants:
|
||||
assert len(data["grants"]) >= 1
|
||||
|
||||
|
||||
class TestSlowQueries:
|
||||
async def test_slow_queries_success(self, client: AsyncClient, test_instance, admin_token):
|
||||
mock_conn, _ = _mock_mysql_connection([
|
||||
{"start_time": "2024-01-01 00:00:00", "user_host": "root[root]@localhost",
|
||||
"query_time": "00:00:05", "lock_time": "00:00:00", "rows_sent": 1,
|
||||
"rows_examined": 1000, "sql_text": "SELECT * FROM big_table"},
|
||||
])
|
||||
|
||||
mock_aiomysql = _make_aiomysql_mock()
|
||||
mock_aiomysql.connect = AsyncMock(return_value=mock_conn)
|
||||
|
||||
with patch.dict(sys.modules, {"aiomysql": mock_aiomysql}):
|
||||
resp = await client.get(
|
||||
"/api/v1/instances/" + str(test_instance.id) + "/detail/slow-queries",
|
||||
params={"database": "test_db"},
|
||||
headers=auth_header(admin_token),
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert isinstance(data, list)
|
||||
|
||||
|
||||
class TestProcesslist:
|
||||
async def test_show_processlist_success(self, client: AsyncClient, test_instance, admin_token):
|
||||
mock_conn, _ = _mock_mysql_connection([
|
||||
|
||||
Reference in new issue
Block a user