Skip to content

Commit

Permalink
Update test_main.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
yqchilde committed Jun 19, 2021
1 parent b8e8e61 commit c55b729
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test_main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import asyncio

from utils.listener import WebSocket
from utils.listener import SmsSocket
from main import ws_conn
from utils.config import get_config

Expand All @@ -18,7 +18,7 @@ def test_websocket():
recv = asyncio.get_event_loop().run_until_complete(ws_conn(get_config()["sms_captcha"]["ws_conn_url"]))
else:
print(f"短信验证码测试,请在手机上访问以下任一个监听地址测试连通性")
recv = WebSocket().listener()
recv = SmsSocket().listener()
if recv != "":
pass
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion utils/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def listener(self, *args, **kwargs):

return json.dumps({"sms_code": a})
except AttributeError:
logger.warning(f"监听到IP: \t{ca[0]}\t访问,但未获取到短信验证码")
logger.warning(f"监听到IP: {ca[0]}访问,但未获取到短信验证码")
except OSError:
logger.warning("请确保你没有打开另外一个监听脚本或jd_tools")

Expand Down

0 comments on commit c55b729

Please sign in to comment.