forked from yqchilde/JDMemberCloseAccount
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main.py
More file actions
30 lines (25 loc) · 877 Bytes
/
Copy pathtest_main.py
File metadata and controls
30 lines (25 loc) · 877 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
30
import sys
import asyncio
from utils.listener import SmsSocket
from main import ws_conn
from utils.config import get_config
def test_websocket():
"""
测试websocket监听验证码转发
:return:
"""
print("开始测试websocket监听验证码转发")
while True:
try:
if get_config()["sms_captcha"]["jd_wstool"]:
recv = asyncio.get_event_loop().run_until_complete(ws_conn(get_config()["sms_captcha"]["ws_conn_url"]))
else:
print(f"短信验证码测试,请在手机上访问以下任一个监听地址测试连通性")
recv = SmsSocket().listener()
if recv != "":
pass
except Exception as e:
print("测试websocket有一点小问题\n", e.args)
sys.exit(1)
if __name__ == '__main__':
test_websocket()