def test_take_turn_monster(): test_mon = gm.Monster('Siff', 1, 1, 1, 1, 1) test_char = gm.Character('Arty') gm.take_turn(test_mon, test_char) actual = test_char.vit expected = 8 assert actual == expected
def test_take_turn_character_defend(): with mock.patch.object(builtins, 'input', lambda _: 'd'): test_char = gm.Character('Arty') test_mon = gm.Monster('Siff', 1, 9, 0, 7, 4) gm.take_turn(test_char, test_mon) actual = test_char.defense expected = 3.0 assert actual == expected
def test_take_turn_character_attack(): with mock.patch.object(builtins, 'input', lambda _: 'a'): test_char = gm.Character('Arty') test_mon = gm.Monster('Siff', 1, 9, 0, 7, 4) gm.take_turn(test_char, test_mon) actual = test_mon.vit expected = 1 assert actual == expected
def test_winfight_potato_gain(): test_char = gm.Character('Arty') test_mon = gm.Monster('Siff', 1, 4, 0, 7, 4) test_reset = test_mon.vit test_mon.vit = 0 gm.winfight(test_mon, test_char, test_reset) actual = test_char.potatoes expected = 125 assert actual == expected
def test_winfight_monster_reset(): test_char = gm.Character('Arty') test_mon = gm.Monster('Siff', 1, 4, 0, 7, 4) test_reset = test_mon.vit test_mon.vit = 0 gm.winfight(test_mon, test_char, test_reset) actual = test_mon.vit expected = 4 assert actual == expected
def test_winfight_exp_gain(): test_char = gm.Character('Arty') test_mon = gm.Monster('Siff', 1, 4, 0, 7, 4) test_reset = test_mon.vit test_mon.vit = 0 gm.winfight(test_mon, test_char, test_reset) actual = test_char.exp_to_level expected = 5 assert actual == expected assert test_char.exp == 4