Skip to content

Commit

Permalink
同时删除 --list 参数
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Apr 16, 2023
1 parent 7545817 commit df4d1c2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
1 change: 0 additions & 1 deletion nonebot_plugin_treehelp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

parser = ArgumentParser("帮助", description="获取插件帮助信息")
parser.add_argument("plugin_name", nargs="?", type=str, help="插件名", metavar="插件名")
parser.add_argument("-l", "--list", action="store_true", help="获取插件列表")
parser.add_argument("-t", "--tree", action="store_true", help="获取插件树")
help_cmd = on_shell_command("help", aliases={"帮助"}, parser=parser)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def test_adapters(app: App):

async with app.test_matcher(help_cmd) as ctx:
bot = ctx.create_bot()
message = message = make_fake_message()("/help --list")
message = message = make_fake_message()("/help")
event = make_fake_event(_message=message)()

ctx.receive_event(bot, event)
Expand Down
16 changes: 1 addition & 15 deletions tests/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ async def test_help(app: App):
ctx.should_finished()


async def test_help_list(app: App):
"""测试查看所有插件"""
from nonebot_plugin_treehelp import help_cmd

async with app.test_matcher(help_cmd) as ctx:
bot = ctx.create_bot()
message = message = make_fake_message()("/help --list")
event = make_fake_event(_message=message)()

ctx.receive_event(bot, event)
ctx.should_call_send(event, "插件:\n帮助 # 获取插件帮助信息", True)
ctx.should_finished()


async def test_help_help(app: App):
"""测试获取帮助插件帮助"""
from nonebot_plugin_treehelp import __plugin_meta__, help_cmd
Expand Down Expand Up @@ -75,7 +61,7 @@ async def test_help_command_error(app: App):
ctx.receive_event(bot, event)
ctx.should_call_send(
event,
"usage: 帮助 [-h] [-l] [-t] [插件名]\n帮助: error: unrecognized arguments: --test\n",
"usage: 帮助 [-h] [-t] [插件名]\n帮助: error: unrecognized arguments: --test\n",
True,
)
ctx.should_finished()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def test_parent(app: App):

async with app.test_matcher(help_cmd) as ctx:
bot = ctx.create_bot()
message = message = make_fake_message()("/help --list")
message = message = make_fake_message()("/help")
event = make_fake_event(_message=message)()

ctx.receive_event(bot, event)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def test_root(app: App):

async with app.test_matcher(help_cmd) as ctx:
bot = ctx.create_bot()
message = message = make_fake_message()("/help --list")
message = message = make_fake_message()("/help")
event = make_fake_event(_message=message)()

ctx.receive_event(bot, event)
Expand Down

0 comments on commit df4d1c2

Please sign in to comment.