Exemplo n.º 1
0
    def test_check_winner_exception(self):
        """ test if the exception is raised"""

        h,c = Hero("foo"),Creature("bar")
        b = Battle(h,c)

        # mock
        h.charge_attack = False
        c.charge_attack = False

        self.assertRaises(ValueError,b.check_winner)
Exemplo n.º 2
0
    def test_check_winner_creature(self):
        """ test if the correct obj is declared winner"""
        
        h,c = Hero("foo"),Creature("bar")
        b = Battle(h,c)

        # mock
        h.charge_attack = True
        c.charge_attack = False

        self.assertEqual(b.check_winner(),"Creature")