forked from rrenaud/dominionstats
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_dominioncards.py
52 lines (32 loc) · 1.17 KB
/
test_dominioncards.py
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
#!/usr/bin/python
import unittest
import dominioncards
class DominionCardsTest(unittest.TestCase):
def test_openings(self):
openings = dominioncards.opening_cards()
self.assertEquals(len(openings), 140)
# Valid opening cards
# Cost 0
self.assertIn(dominioncards.Copper, openings)
# Cost 2
self.assertIn(dominioncards.Chapel, openings)
# Cost 3
self.assertIn(dominioncards.Ambassador, openings)
# Cost 4
self.assertIn(dominioncards.Baron, openings)
# Cost 5
self.assertIn(dominioncards.Bazaar, openings)
# Non-openings
# Requires a potion, can't be an opening
self.assertNotIn(dominioncards.Alchemist, openings)
# Too expensive
self.assertNotIn(dominioncards.Bank, openings)
def test_initialization(self):
"""Test various ways of initializing card objects
"""
card = dominioncards.get_card('Estate')
self.assertEquals(card.singular, 'Estate')
card = dominioncards.get_card('Card(Estate)')
self.assertEquals(card.singular, 'Estate')
if __name__ == '__main__':
unittest.main()