def test_first_to_be_done_discarding(self, two_player_game_unstarted):
    fake_redis = fakeredis.FakeRedis()
    fake_redis.set('cheers', json.dumps(two_player_game_unstarted))
    bev.cache = fake_redis
    bev.start_game('cheers')
    bev.deal_hands('cheers')
    g = json.loads(fake_redis.get('cheers'))
    (_, _) = bev.discard('cheers', 'sam', g['hands']['sam'][0])
    (player_done, all_done) = bev.discard('cheers', 'sam', g['hands']['sam'][1])
    assert player_done
    assert (not all_done)
    assert (g['state'] == 'DISCARD')
def test_first_to_be_done_discarding(self, two_player_game_unstarted):
    fake_redis = fakeredis.FakeRedis()
    fake_redis.set('cheers', json.dumps(two_player_game_unstarted))
    bev.cache = fake_redis
    bev.start_game('cheers')
    bev.deal_hands('cheers')
    g = json.loads(fake_redis.get('cheers'))
    (_, _) = bev.discard('cheers', 'sam', g['hands']['sam'][0])
    (player_done, all_done) = bev.discard('cheers', 'sam', g['hands']['sam'][1])
    assert player_done
    assert (not all_done)
    assert (g['state'] == 'DISCARD')