New mana cost tests, including unsupported snow and hybrid costs

This commit is contained in:
Correl Roush 2010-09-02 09:47:09 -04:00
parent cd179365e7
commit 234a77cdbc

16
test.py
View file

@ -10,6 +10,22 @@ class TestManaMath(unittest.TestCase):
self.assertRaises(Exception, lambda: Mana('r') - Mana('rr')) self.assertRaises(Exception, lambda: Mana('r') - Mana('rr'))
self.assertRaises(Exception, lambda: Mana('r') - Mana('g')) self.assertRaises(Exception, lambda: Mana('r') - Mana('g'))
class TestManaCost(unittest.TestCase):
def test_uncolored(self):
self.assertEquals('3', str(ManaCost('3')))
def test_colored(self):
self.assertEquals('RU', str(ManaCost('RU')))
def test_combined(self):
self.assertEquals('3RR', str(ManaCost('3RR')))
def test_mana(self):
self.assertEquals('BBW', str(ManaCost(Mana('BBW'))))
def test_hybrid_monocolor(self):
self.assertEquals('(1/U)', str(ManaCost('(1/U)')))
def test_hybrid_multicolor(self):
self.assertEquals('(W/R)', str(ManaCost('(W/R)')))
def test_snow(self):
self.assertEquals('S', str(ManaCost('S')))
class TestManaCostMath(unittest.TestCase): class TestManaCostMath(unittest.TestCase):
def test_add_manacost(self): def test_add_manacost(self):
self.assertEquals('3R', str(ManaCost('2R') + ManaCost('1'))) self.assertEquals('3R', str(ManaCost('2R') + ManaCost('1')))