Add @help edit for modifying existing topics
This commit is contained in:
parent
e94e92acea
commit
24154a052c
1 changed files with 25 additions and 0 deletions
|
|
@ -202,3 +202,28 @@ async def test_at_help_create_no_args_prompts_name(admin_player):
|
|||
await commands.dispatch(admin_player, "@help create")
|
||||
output = "".join(c[0][0] for c in admin_player.writer.write.call_args_list)
|
||||
assert "name" in output.lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_at_help_edit_unknown_topic(admin_player):
|
||||
await commands.dispatch(admin_player, "@help edit bogus")
|
||||
output = "".join(c[0][0] for c in admin_player.writer.write.call_args_list)
|
||||
assert "not found" in output.lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_at_help_edit_no_args(admin_player):
|
||||
await commands.dispatch(admin_player, "@help edit")
|
||||
output = "".join(c[0][0] for c in admin_player.writer.write.call_args_list)
|
||||
assert "usage" in output.lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_at_help_edit_prompts_title(admin_player):
|
||||
_help_topics["combat"] = HelpTopic(
|
||||
name="combat", body="old body", title="combat primer"
|
||||
)
|
||||
await commands.dispatch(admin_player, "@help edit combat")
|
||||
output = "".join(c[0][0] for c in admin_player.writer.write.call_args_list)
|
||||
# Should show current title as default
|
||||
assert "combat primer" in output
|
||||
|
|
|
|||
Loading…
Reference in a new issue