From 822a17ba63f05d9ec3c2fb667de93f1c1e95616f Mon Sep 17 00:00:00 2001 From: BattleJenkins Date: Fri, 7 Apr 2017 10:52:58 -0700 Subject: [PATCH] Added turnbattle command tests Added unit tests for the combat commands in the new 'turnbattle.py' contrib module. --- evennia/contrib/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/evennia/contrib/tests.py b/evennia/contrib/tests.py index 62f71281bb..18f8817c06 100644 --- a/evennia/contrib/tests.py +++ b/evennia/contrib/tests.py @@ -755,4 +755,15 @@ class TestTutorialWorldRooms(CommandTest): def test_outroroom(self): create_object(tutrooms.OutroRoom, key="outroroom") +# test turnbattle +from evennia.contrib import turnbattle +class TestTurnBattle(CommandTest): + + # Test combat commands + def test_turnbattlecmd(self): + self.call(turnbattle.CmdFight(), "", "You can't start a fight if you've been defeated!") + self.call(turnbattle.CmdAttack(), "", "You can only do that in combat. (see: help fight)") + self.call(turnbattle.CmdPass(), "", "You can only do that in combat. (see: help fight)") + self.call(turnbattle.CmdDisengage(), "", "You can only do that in combat. (see: help fight)") + self.call(turnbattle.CmdRest(), "", "Char rests to recover HP.")