Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Aug 14, 2023
1 parent c9be485 commit 0e59cd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion sql/engines/test_cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def test_get_all_tables(self, mock_query):
def test_describe_table(self, mock_query):
mock_query.return_value = ResultSet()
self.engine.describe_table("some_db", "some_table")
mock_query.assert_called_once_with(db_name="some_db", sql="describe table some_table")
mock_query.assert_called_once_with(
db_name="some_db", sql="describe table some_table"
)

@patch("sql.engines.cassandra.CassandraEngine.query")
def test_get_all_columns_by_tb(self, mock_query):
Expand Down
17 changes: 8 additions & 9 deletions sql/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
import re
import unittest
from datetime import timedelta, datetime, date
from unittest.mock import MagicMock, patch, ANY
Expand Down Expand Up @@ -745,7 +744,7 @@ def test_query_priv_check_tb_priv_exist(self, __db_priv, __tb_priv, __table_ref)
@patch("sql.query_privileges._tb_priv", return_value=False)
@patch("sql.query_privileges._db_priv", return_value=False)
def test_query_priv_check_table_ref_Exception_and_no_db_priv(
self, __db_priv, __tb_priv, __table_ref
self, __db_priv, __tb_priv, __table_ref
):
"""
测试用户权限校验,mysql实例、普通用户 ,inception语法树抛出异常
Expand Down Expand Up @@ -2552,7 +2551,7 @@ def test_param_history(self):
@patch("sql.engines.mysql.MysqlEngine.get_variables")
@patch("sql.engines.get_engine")
def test_param_edit_variable_not_config(
self, _get_engine, _get_variables, _set_variable
self, _get_engine, _get_variables, _set_variable
):
"""
测试参数修改,参数未在模板配置
Expand All @@ -2572,7 +2571,7 @@ def test_param_edit_variable_not_config(
@patch("sql.engines.mysql.MysqlEngine.get_variables")
@patch("sql.engines.get_engine")
def test_param_edit_variable_not_change(
self, _get_engine, _get_variables, _set_variable
self, _get_engine, _get_variables, _set_variable
):
"""
测试参数修改,已在参数模板配置,但是值无变化
Expand Down Expand Up @@ -2602,7 +2601,7 @@ def test_param_edit_variable_not_change(
@patch("sql.engines.mysql.MysqlEngine.get_variables")
@patch("sql.engines.get_engine")
def test_param_edit_variable_change(
self, _get_engine, _get_variables, _set_variable
self, _get_engine, _get_variables, _set_variable
):
"""
测试参数修改,已在参数模板配置,且值有变化
Expand Down Expand Up @@ -2632,7 +2631,7 @@ def test_param_edit_variable_change(
@patch("sql.engines.mysql.MysqlEngine.get_variables")
@patch("sql.engines.get_engine")
def test_param_edit_variable_error(
self, _get_engine, _get_variables, _set_variable
self, _get_engine, _get_variables, _set_variable
):
"""
测试参数修改,已在参数模板配置,修改抛错
Expand Down Expand Up @@ -2837,7 +2836,7 @@ def test_notify_for_sqlreview_audit_abort(self, _auth_group_users, _msg_sender):
@patch("sql.notify.MsgSender")
@patch("sql.notify.auth_group_users")
def test_notify_for_sqlreview_wrong_workflow_type(
self, _auth_group_users, _msg_sender
self, _auth_group_users, _msg_sender
):
"""
测试不存在的工单类型
Expand All @@ -2857,7 +2856,7 @@ def test_notify_for_sqlreview_wrong_workflow_type(
@patch("sql.notify.MsgSender")
@patch("sql.notify.auth_group_users")
def test_notify_for_query_audit_wait_apply_db_perm(
self, _auth_group_users, _msg_sender
self, _auth_group_users, _msg_sender
):
"""
测试查询申请库权限
Expand All @@ -2883,7 +2882,7 @@ def test_notify_for_query_audit_wait_apply_db_perm(
@patch("sql.notify.MsgSender")
@patch("sql.notify.auth_group_users")
def test_notify_for_query_audit_wait_apply_tb_perm(
self, _auth_group_users, _msg_sender
self, _auth_group_users, _msg_sender
):
"""
测试查询申请表权限
Expand Down

0 comments on commit 0e59cd1

Please sign in to comment.