mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
Bump up coverage for puzzles module
This commit is contained in:
parent
f70b2b94dd
commit
b747aa0e05
2 changed files with 8 additions and 2 deletions
|
|
@ -305,7 +305,7 @@ class CmdEditPuzzle(MuxCommand):
|
|||
|
||||
puzzle = search.search_script(recipe_dbref)
|
||||
if not puzzle or not inherits_from(puzzle[0], PuzzleRecipe):
|
||||
caller.msg('Invalid puzzle %r' % (recipe_dbref))
|
||||
caller.msg('%s(%s) is not a puzzle' % (puzzle[0].name, recipe_dbref))
|
||||
return
|
||||
|
||||
puzzle = puzzle[0]
|
||||
|
|
|
|||
|
|
@ -1440,17 +1440,23 @@ class TestPuzzles(CommandTest):
|
|||
self.fire.delete()
|
||||
|
||||
def _puzzleedit(swt, dbref, args, expmsg):
|
||||
if (swt is None) and (dbref is None) and (args is None):
|
||||
cmdstr = ''
|
||||
else:
|
||||
cmdstr = '%s %s%s' % (swt, dbref, args)
|
||||
self.call(
|
||||
puzzles.CmdEditPuzzle(),
|
||||
'%s %s%s' % (swt, dbref, args),
|
||||
cmdstr,
|
||||
expmsg,
|
||||
caller=self.char1
|
||||
)
|
||||
|
||||
# bad syntax
|
||||
_puzzleedit(None, None, None, "A puzzle recipe's #dbref must be specified.\nUsage: @puzzleedit")
|
||||
_puzzleedit('', '1', '', "A puzzle recipe's #dbref must be specified.\nUsage: @puzzleedit")
|
||||
_puzzleedit('', '', '', "A puzzle recipe's #dbref must be specified.\nUsage: @puzzleedit")
|
||||
_puzzleedit('', recipe_dbref, 'dummy', "A puzzle recipe's #dbref must be specified.\nUsage: @puzzleedit")
|
||||
_puzzleedit('', self.script.dbref, '', 'Script(#1) is not a puzzle')
|
||||
|
||||
# no permissions
|
||||
_puzzleedit('', recipe_dbref, '/use_success_message = Yes!', "You don't have permission")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue