def test_if_player_deal_damage_alter_enemy_stats(self, mock_input,
                                                  mock_choice):
     enemy = {"Health": 5}
     player_deal_damage(enemy, "Demon")
     expected_new_enemy_health_value = 2
     self.assertEqual(expected_new_enemy_health_value, enemy["Health"])
 def test_player_deal_damage_and_kill_enemy_return_value(
         self, mock_input, mock_choice):
     expected_output = "over"
     demon = {"Health": 5}
     actual_output = player_deal_damage(demon, "Demon")
     self.assertEqual(expected_output, actual_output)
 def test_player_deal_damage_and_kill_enemy_printed_output(
         self, mock_stdout, mock_input, mock_choice):
     demon = {"Health": 5}
     player_deal_damage(demon, "Demon")
     self.assertEqual(mock_stdout.getvalue(), "You kill the Demon!\n")
 def test_player_deal_damage_but_not_kill_return_value(
         self, mock_input, mock_choice):
     expected_output = "enemy retaliates"
     demon = {"Health": 5}
     actual_output = player_deal_damage(demon, "Demon")
     self.assertEqual(expected_output, actual_output)
 def test_player_deal_damage_but_not_kill_printed_output(
         self, mock_stdout, mock_input, mock_choice):
     demon = {"Health": 5}
     player_deal_damage(demon, "Demon")
     self.assertEqual(mock_stdout.getvalue(), "The Demon lost 3 HP!!\n")