예제 #1
0
    def _assertGet(self, client=None):
        deck_id = self.deck_id
        shard = self.shard
        card_and_appearance = self.card_and_appearance
        player_id = self.player_id

        init(deck_id, card_and_appearance, shard, client)

        for n in xrange(0, 300):
            self.assertIn(get(deck_id, player_id, client), ['1', '2', '3', '4'])
예제 #2
0
    def _assertGet(self, client=None):
        deck_id = self.deck_id
        shard = self.shard
        card_and_appearance = self.card_and_appearance
        player_id = self.player_id

        init(deck_id, card_and_appearance, shard, client)

        for n in xrange(0, 300):
            self.assertIn(get(deck_id, player_id, client),
                          ['1', '2', '3', '4'])
예제 #3
0
    def _assertInit(self, client=None):
        glot = self.glot
        deck_id = self.deck_id
        shard = self.shard
        card_and_appearance = self.card_and_appearance

        init(deck_id, card_and_appearance, shard, client)
        self.assertEqual(glot._get_shard(deck_id), shard)

        current = glot._get_deck_current(deck_id)
        self.assertEqual(current, 'Switch')

        glot._do_shard(deck_id, shard,
                       lambda key: self.assertEqual(glot.r.llen(key), 100),
                       current)
예제 #4
0
    def _assertInit(self, client=None):
        glot = self.glot
        deck_id = self.deck_id
        shard = self.shard
        card_and_appearance = self.card_and_appearance

        init(deck_id, card_and_appearance, shard, client)
        self.assertEqual(glot._get_shard(deck_id), shard)

        current = glot._get_deck_current(deck_id)
        self.assertEqual(current, 'Switch')

        glot._do_shard(
            deck_id, shard,
            lambda key: self.assertEqual(glot.r.llen(key), 100),
            current
        )
예제 #5
0
 def init(self, *args, **kwargs):
     return glot.init(client=self.redis, *args, **kwargs)
예제 #6
0
파일: lottery.py 프로젝트: subc/anchovy
 def init(self, *args, **kwargs):
     return glot.init(client=self.redis, *args, **kwargs)