Beispiel #1
0
 def test_if_player_deal_damage2_alter_enemy_stats(self, mock_input,
                                                   mock_choice):
     enemy = {"Health": 5}
     player_deal_damage2(enemy, "Demon")
     expected_new_enemy_health_value = 2
     self.assertEqual(expected_new_enemy_health_value, enemy["Health"])
Beispiel #2
0
 def test_player_deal_damage_and_kill_enemy_printed_output(
         self, mock_stdout, mock_input, mock_choice):
     demon = {"Health": 5}
     player_deal_damage2(demon, "Demon")
     self.assertEqual(mock_stdout.getvalue(), "You kill the Demon.\n")
Beispiel #3
0
 def test_player_deal_damage2_and_kill_enemy_return_value(
         self, mock_input, mock_choice):
     expected_output = "over"
     demon = {"Health": 5}
     actual_output = player_deal_damage2(demon, "Demon")
     self.assertEqual(expected_output, actual_output)
Beispiel #4
0
 def test_player_deal_damage2_but_not_kill_printed_output(
         self, mock_stdout, mock_input, mock_choice):
     demon = {"Health": 5}
     player_deal_damage2(demon, "Demon")
     self.assertEqual(mock_stdout.getvalue(), "The Demon lost 3 HP!!\n")