Skip to content

Commit

Permalink
blm新增bili_live_ws测试组件
Browse files Browse the repository at this point in the history
目前只有测试数据包解析
  • Loading branch information
pskdje committed Nov 15, 2024
1 parent f0d189b commit 0397076
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions blm/test_blw.py
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()

0 comments on commit 0397076

Please sign in to comment.