# evennia.contrib.tutorials.evadventure.tests.test_combat

Test EvAdventure combat.

class `evennia.contrib.tutorials.evadventure.tests.test_combat.``EvAdventureTurnbasedCombatHandlerTest`(methodName='runTest')

  Bases: `evennia.contrib.tutorials.evadventure.tests.mixins.EvAdventureMixin`, `evennia.utils.test_resources.BaseEvenniaTest`

  Test methods on the turn-based combat handler.

  `maxDiff` = None
  `setUp`()

    Sets up testing environment

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  `test_remove_combatant`()
  `test_start_turn`()
  `test_end_of_turn__empty`()
  `test_add_combatant`()
  `test_start_combat`()
  `test_combat_summary`()
  `test_msg`()
  `test_gain_advantage`()
  `test_gain_disadvantage`()
  `test_flee`()
  `test_unflee`()
  `test_register_and_run_action`()
  `test_get_available_actions`()

class `evennia.contrib.tutorials.evadventure.tests.test_combat.``EvAdventureTurnbasedCombatActionTest`(methodName='runTest')

  Bases: `evennia.contrib.tutorials.evadventure.tests.mixins.EvAdventureMixin`, `evennia.utils.test_resources.BaseEvenniaTest`

  Test actions in turn_based combat.

  `setUp`()

    Sets up testing environment

  `test_do_nothing`()
  `test_attack__miss`(mock_randint)
  `test_attack__success__still_alive`(mock_randint)
  `test_attack__success__kill`(mock_randint)
  `test_stunt_fail`(mock_randint)
  `test_stunt_advantage__success`(mock_randint)
  `test_stunt_disadvantage__success`(mock_randint)
  `test_use_item`()

    Use up a potion during combat.

  `test_swap_wielded_weapon_or_spell`()

    First draw a weapon (from empty fists), then swap that out to another weapon, then swap to a spell rune.

  `test_flee__success`()

    Test fleeing twice, leading to leaving combat.

  `test_flee__blocked`(mock_randint)