mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2025-11-25 03:15:17 +08:00
feat: 完善类型注释,增加 mypy 类型检测
This commit is contained in:
1
test/__init__.py
Normal file
1
test/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
13
test/test_utils.py
Normal file
13
test/test_utils.py
Normal 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()
|
||||
Reference in New Issue
Block a user