From 0397076b985bb3add5480a6030678daeafcae74f Mon Sep 17 00:00:00 2001 From: pskdje <77605497+pskdje@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:32:40 +0800 Subject: [PATCH] =?UTF-8?q?blm=E6=96=B0=E5=A2=9Ebili=5Flive=5Fws=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=BB=84=E4=BB=B6=20=E7=9B=AE=E5=89=8D=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E5=8C=85=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blm/test_blw.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 blm/test_blw.py diff --git a/blm/test_blw.py b/blm/test_blw.py new file mode 100644 index 0000000..b61c08b --- /dev/null +++ b/blm/test_blw.py @@ -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()