summaryrefslogtreecommitdiff
path: root/22/test.py
blob: 8410d32ce0eb262e2d009240469ba24a51e19959 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python

import unittest

import main



class ExamplesPart1(unittest.TestCase):
    def test_example1(self):
        player = main.Entity()
        player.health =  10
        player.armour =   0
        player.mana   = 250

        boss = main.Entity()
        boss.health = 13
        boss.damage =  8

        result = main.solve_partn(1, player, boss)
        self.assertEqual(result, 173 + 53)

    def test_example2(self):
        player = main.Entity()
        player.health =  10
        player.armour =   0
        player.mana   = 250

        boss = main.Entity()
        boss.health = 14
        boss.damage =  8

        result = main.solve_partn(1, player, boss)
        self.assertEqual(result, 229 + 113 + 73 + 173 + 53)



if __name__ == "__main__":
    unittest.main()