コード例 #1
0
ファイル: util.py プロジェクト: Julian/cardboard
class GameTestCase(EventHandlerTestCase):

    TEST_LIBRARY_SIZE = 12

    user = TestingUser()
    libraries = [
        [mock.Mock(spec=Card) for _ in range(TEST_LIBRARY_SIZE)]
        for _ in range(4)
    ]

    library = libraries[-1]

    def setUp(self):
        super(GameTestCase, self).setUp()
        self.game = Game(self.events)
        self.p1 = self.game.add_player(
            user=self.user, library=self.libraries[0], name=u"1"
        )
        self.p2 = self.game.add_player(
            user=self.user, library=self.libraries[1], name=u"2"
        )
        self.p3 = Player(
            user=self.user, game=self.game,
            library=self.libraries[2], name=u"3"
        )
コード例 #2
0
ファイル: util.py プロジェクト: Julian/cardboard
 def setUp(self):
     super(GameTestCase, self).setUp()
     self.game = Game(self.events)
     self.p1 = self.game.add_player(
         user=self.user, library=self.libraries[0], name=u"1"
     )
     self.p2 = self.game.add_player(
         user=self.user, library=self.libraries[1], name=u"2"
     )
     self.p3 = Player(
         user=self.user, game=self.game,
         library=self.libraries[2], name=u"3"
     )