mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
✅ Update Unit Test
Co-authored-by: xtaodada <xtao@xtaolink.cn>
This commit is contained in:
parent
a044de8582
commit
3839d00a95
@ -62,7 +62,6 @@ class _Plugin:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _new_chat_members_handler_funcs(self) -> List[Tuple[int, Callable]]:
|
def _new_chat_members_handler_funcs(self) -> List[Tuple[int, Callable]]:
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for attr in dir(self):
|
for attr in dir(self):
|
||||||
# noinspection PyUnboundLocalVariable
|
# noinspection PyUnboundLocalVariable
|
||||||
|
@ -22,7 +22,6 @@ class HTTPXRequest(AbstractAsyncContextManager):
|
|||||||
async def __aexit__(
|
async def __aexit__(
|
||||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
await self.initialize()
|
await self.initialize()
|
||||||
|
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
|
@ -112,13 +112,13 @@ class TestMaterial:
|
|||||||
async def test_get_by_name():
|
async def test_get_by_name():
|
||||||
material = await Material.get_by_name("地脉的新芽")
|
material = await Material.get_by_name("地脉的新芽")
|
||||||
assert material.id == "i_73"
|
assert material.id == "i_73"
|
||||||
assert material.type == "角色培养素材"
|
assert material.type == "角色与武器培养素材"
|
||||||
assert "60级以上深渊法师掉落" in material.source
|
assert "60级以上深渊法师掉落" in material.source
|
||||||
assert "勃发" in material.description
|
assert "勃发" in material.description
|
||||||
|
|
||||||
material = await Material.get_by_name("「黄金」的教导")
|
material = await Material.get_by_name("「黄金」的教导")
|
||||||
assert material.id == "i_431"
|
assert material.id == "i_431"
|
||||||
assert material.type == "天赋培养素材"
|
assert material.type == "角色天赋素材"
|
||||||
assert 2 in material.weekdays
|
assert 2 in material.weekdays
|
||||||
assert "土的象" in material.description
|
assert "土的象" in material.description
|
||||||
|
|
||||||
|
@ -114,7 +114,6 @@ class Traceback(BaseTraceback):
|
|||||||
locals_max_depth: Optional[int]
|
locals_max_depth: Optional[int]
|
||||||
|
|
||||||
def __init__(self, *args, locals_max_depth: Optional[int] = None, **kwargs):
|
def __init__(self, *args, locals_max_depth: Optional[int] = None, **kwargs):
|
||||||
|
|
||||||
kwargs.update({"show_locals": True})
|
kwargs.update({"show_locals": True})
|
||||||
super(Traceback, self).__init__(*args, **kwargs)
|
super(Traceback, self).__init__(*args, **kwargs)
|
||||||
self.locals_max_depth = locals_max_depth
|
self.locals_max_depth = locals_max_depth
|
||||||
@ -291,7 +290,6 @@ class Traceback(BaseTraceback):
|
|||||||
|
|
||||||
excluded = False
|
excluded = False
|
||||||
for frame_index, frame in enumerate(stack.frames):
|
for frame_index, frame in enumerate(stack.frames):
|
||||||
|
|
||||||
if exclude_frames and frame_index in exclude_frames:
|
if exclude_frames and frame_index in exclude_frames:
|
||||||
excluded = True
|
excluded = True
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user