<s> import pytest <EOL> from modules . hp import HealthPoints <EOL> from modules . engine import Engine <EOL> @ pytest . fixture <EOL> def player ( ) : <EOL> player = HealthPoints ( <NUM_LIT:100> ) <EOL> return player <EOL> @ pytest . fixture <EOL> def player_with_bonus ( ) : <EOL> player = HealthPoints ( <NUM_LIT:100> ) <EOL> player . item_bonuses = <NUM_LIT:10> <EOL> player . other_bonuses = <NUM_LIT:15> <EOL> return player <EOL> def test_initalizing_base ( player ) : <EOL> assert player . base == <NUM_LIT:100> <EOL> def test_item_bonuses_return_none ( player ) : <EOL> assert player . item_bonuses == <NUM_LIT:0> <EOL> def test_other_bonuses_return_none ( player ) : <EOL> assert player . other_bonuses == <NUM_LIT:0> <EOL> def test_take_damage ( player ) : <EOL> player . take_damage ( <NUM_LIT:10> ) <EOL> assert player . calc_health ( ) == <NUM_LIT> <EOL> @ pytest . fixture <EOL> def player_with_bonus ( player ) : <EOL> player . item_bonuses = <NUM_LIT:10> <EOL> player . other_bonuses = <NUM_LIT:15> <EOL> return player <EOL> def test_calc_health_returns_total ( player_with_bonus ) : <EOL> assert player_with_bonus . calc_health ( ) == <NUM_LIT> <EOL> player_with_bonus . take_damage ( <NUM_LIT> ) <EOL> assert player_with_bonus . calc_health ( ) == <NUM_LIT> <EOL> def test_print_health_function ( capsys , player_with_bonus ) : <EOL> print ( player_with_bonus . show_health ( ) ) <EOL> output , err = capsys . readouterr ( ) <EOL> assert "<STR_LIT>" == output </s>
