Timo Boettcher  committed 310e83a

add unittest for hinterlands

  • Participants
  • Parent commits 8b27704
  • Branches default

Comments (0)

Files changed (2)

File domination/cards/

         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/

 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 import CardTypeRegistry, Cornucopia
+from import CardTypeRegistry, Cornucopia, Hinterlands
 from import ThroneRoom, Smithy
 from 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()