-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
目前只有测试数据包解析
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""bili_live_ws.py测试""" | ||
|
||
import unittest | ||
import json | ||
from pathlib import Path | ||
|
||
class PackTest(unittest.TestCase): | ||
"""数据包处理测试""" | ||
def setUp(self): | ||
import bili_live_ws as blw | ||
self.blw=blw | ||
self.arg=blw.pararg(args=["1"]) | ||
blwp=Path("bili_live_ws_pack") | ||
self.packlist=blwp.glob("*.json") | ||
def test_pack(self): | ||
for pp in self.packlist: | ||
p=json.loads(pp.read_text()) | ||
with self.subTest(name=pp.name): | ||
try: | ||
self.blw.pac(p,self.arg) | ||
except self.blw.SavePack: | ||
pass | ||
|
||
if __name__=="__main__": | ||
unittest.main() |