- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_kingmaker.py
More file actions
Latest commit
57 lines (45 loc) · 1.43 KB
/
Copy pathtest_kingmaker.py
File metadata and controls
57 lines (45 loc) · 1.43 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'''
Created on Feb 11, 2014
@author: rwill127
'''
fromnose.toolsimport*
importkingmakerask
classTestNode(object):
defsetup(self):
self.n=k.Node(1, 1)
deftest_node_init(self):
eq_(self.n.occupied, False)
classTestGrid(object):
defsetup(self):
self.g=k.Grid()
deftest_grid_init(self):
eq_(len(self.g.nodes), 8)
eq_(len(self.g.nodes[0]), 8)
ok_(isinstance(self.g.nodes[0][0], k.Node))
deftest_get_node(self):
n=self.g.get_node(3, 4)
eq_(n.x, 3)
eq_(n.y, 4)
classTestChar(object):
defsetup(self):
self.c=k.Character()
self.nigel_profile= {"Name": "Nigel",
"STR": 16,
"DEX": 13,
"CON": 17,
"INT": 15,
"WIS": 20,
"CHA": 14
}
deftest_get_mod(self):
self.c.strength=18
str_mod=self.c.get_mod(self.c.strength)
eq_(str_mod, 4)
self.c.wisdom=9
wis_mod=self.c.get_mod(self.c.wisdom)
eq_(wis_mod, -1)
deftest_setup(self):
self.c.setup(self.nigel_profile)
ok_(self.c.name=="Nigel")
ok_(self.c.wisdom==20)
ok_(self.c.get_mod(self.c.wisdom)==5)