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'])
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)
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 )
def init(self, *args, **kwargs): return glot.init(client=self.redis, *args, **kwargs)