-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_tools.py
More file actions
29 lines (24 loc) · 966 Bytes
/
test_tools.py
File metadata and controls
29 lines (24 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from tools import SQLQuery, EmailSQLBuilder, TicketSQLBuilder, LogQuery
def test_tools():
# 初始化工具实例
sql_query = SQLQuery()
email_builder = EmailSQLBuilder()
ticket_builder = TicketSQLBuilder()
log_query = LogQuery()
# 测试email查询
email_id = "A732EA9F64CC8AEAFDB4368F53B907593108"
email_sql = email_builder.build_query(email_id)
email_result = sql_query.execute_query(email_sql)
print(f"Email查询结果: {email_result}")
# 测试ticket查询
ticket_id = "XM202503181059"
ticket_sql = ticket_builder.build_query(ticket_id)
ticket_result = sql_query.execute_query(ticket_sql)
print(f"Ticket查询结果: {ticket_result}")
# 测试日志查询
log_name = "EmailAnalysisAssistant_20250419.log"
keyword = "error"
log_result = log_query.search_log(log_name, keyword)
print(f"日志查询结果: {log_result}")
if __name__ == "__main__":
test_tools()