Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Nov 30, 2023
1 parent 301c3f9 commit 45d5f49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 10 additions & 4 deletions sql/utils/test_workflow_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
WorkflowAuditSetting,
)
from sql.utils.tests import User
from sql.utils.workflow_audit import Audit, AuditV2, AuditSetting, AuditException, ReviewNodeType
from sql.utils.workflow_audit import (
Audit,
AuditV2,
AuditSetting,
AuditException,
ReviewNodeType,
)


class TestAudit(TestCase):
Expand Down Expand Up @@ -549,9 +555,9 @@ def test_get_review_info(


def test_get_review_info_auto_pass(
sql_query_apply,
fake_generate_audit_setting,
admin_client,
sql_query_apply,
fake_generate_audit_setting,
admin_client,
):
# 自动通过的情况
fake_generate_audit_setting.return_value = AuditSetting(auto_pass=True)
Expand Down
5 changes: 4 additions & 1 deletion sql/utils/workflow_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ class ReviewNode:

def __post_init__(self):
if self.node_type == ReviewNodeType.GROUP and not self.group:
raise ValueError(f"group not provided and node_type is set as {self.node_type}")
raise ValueError(
f"group not provided and node_type is set as {self.node_type}"
)

@property
def is_auto_pass(self):
return self.node_type == ReviewNodeType.AUTO_PASS


@dataclass
class ReviewInfo:
nodes: List[ReviewNode] = field(default_factory=list)
Expand Down

0 comments on commit 45d5f49

Please sign in to comment.