1. Alexander Schremmer
  2. domination


Timo Boettcher  committed 310e83a

add unittest for hinterlands

  • Participants
  • Parent commits 8b27704
  • Branches default

Comments (0)

Files changed (2)

File domination/cards/__init__.py

View file
  • Ignore whitespace
         return classes
+    @staticmethod
+    def cards_from_edition(edition):
+        return [c for c in CardTypeRegistry.raw_card_classes.values() if c.edition == edition and c.implemented]
 class Card(object):
     __metaclass__ = CardTypeRegistry

File domination/tests/test_gameengine.py

View file
  • Ignore whitespace
 from random import SystemRandom
 from werkzeug import abort # WTH fails the import of this file without this import?
 from domination.gameengine import Player, DominationGame, InfoRequest, EndOfGameException, card_sets, Checkpoint
-from domination.cards import CardTypeRegistry, Cornucopia
+from domination.cards import CardTypeRegistry, Cornucopia, Hinterlands
 from domination.cards.base import ThroneRoom, Smithy
 from domination.cards.intrigue import Baron
     def test_baron(self):
         for _ in xrange(2**6):
             yield self.do_test_run, [Baron] * 9 + [Smithy]
+    def test_hinterlands(self):
+        def sample_hinterlands():
+            return random.sample(CardTypeRegistry.cards_from_edition(Hinterlands), 10)
+        for _ in xrange(2**8):
+            yield self.do_test_run, sample_hinterlands()