Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (28 sloc) 1.036 kb
#!/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()
Jump to Line
Something went wrong with that request. Please try again.