-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtest_count_buys.py
37 lines (28 loc) · 1.01 KB
/
test_count_buys.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError, e:
import unittest
import count_buys
class TestBuyStats(unittest.TestCase):
def test_merge_buy_stat(self):
a = count_buys.BuyStat()
b = count_buys.BuyStat()
a.available.add_outcome(1)
b.available.add_outcome(3)
self.assertEquals(a.available.real_frequency(), 1)
self.assertEquals(b.available.real_frequency(), 1)
b.merge(a)
self.assertEquals(b.available.real_frequency(), 2)
def test_merge_deck_buy_stats(self):
a = count_buys.DeckBuyStats()
b = count_buys.DeckBuyStats()
a['Estate'].available.add_outcome(2)
b['Estate'].available.add_outcome(0)
self.assertEquals(a['Estate'].available.real_frequency(), 1)
self.assertEquals(b['Estate'].available.real_frequency(), 1)
b.merge(a)
self.assertEquals(b['Estate'].available.real_frequency(), 2)
if __name__ == '__main__':
unittest.main()