feat: 完善类型注释,增加 mypy 类型检测

This commit is contained in:
Nanmi
2023-07-16 17:57:18 +08:00
parent e5bdc63323
commit 745e59c875
18 changed files with 116 additions and 90 deletions

1
test/__init__.py Normal file
View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

13
test/test_utils.py Normal file
View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from tools import utils
def test_convert_cookies():
xhs_cookies = "a1=x000101360; webId=1190c4d3cxxxx125xxx; "
cookie_dict = utils.convert_str_cookie_to_dict(xhs_cookies)
assert cookie_dict.get("webId") == "1190c4d3cxxxx125xxx"
assert cookie_dict.get("a1") == "x000101360"
if __name__ == '__main__':
test_convert_cookies()