@mock.patch('app.award_points', mock.MagicMock(return_value=False))
def test_fifteen_two(self):
    fake_redis = fakeredis.FakeRedis()
    game_dict = {'cards': CARDS, 'hands': {'kathy': ['EXAMPLE_KEY', 'c6f4900f82'], 'tom': ['ace1293f8a']}, 'pegging': {'cards': ['4de6b73ab8'], 'last_played': 'tom', 'passed': [], 'run': [], 'total': 8}, 'players': {'tom': 0, 'kathy': 0}, 'played_cards': {'kathy': [], 'tom': []}, 'scoring_stats': {'tom': {'a_play': 0, 'b_hand': 0, 'c_crib': 0}, 'kathy': {'a_play': 0, 'b_hand': 0, 'c_crib': 0}}, 'state': 'PLAY', 'turn': 'kathy', 'winning_score': 121}
    fake_redis.set('test', json.dumps(game_dict))
    bev.cache = fake_redis
    seven_of_clubs = 'c6f4900f82'
    (just_won, points, points_source) = bev.score_play('test', 'kathy', seven_of_clubs)
    assert (not just_won)
    bev.record_play('test', 'kathy', seven_of_clubs)
    g = json.loads(fake_redis.get('test'))
    assert (g['players']['kathy'] == 2)
    assert (g['pegging']['total'] == 15)
    assert (set(g['pegging']['cards']) == set(['4de6b73ab8', 'c6f4900f82']))
    assert (g['hands']['kathy'] == ['EXAMPLE_KEY'])
@mock.patch('app.award_points', mock.MagicMock(return_value=False))
def test_fifteen_two(self):
    fake_redis = fakeredis.FakeRedis()
    game_dict = {'cards': CARDS, 'hands': {'kathy': ['EXAMPLE_KEY', 'c6f4900f82'], 'tom': ['ace1293f8a']}, 'pegging': {'cards': ['4de6b73ab8'], 'last_played': 'tom', 'passed': [], 'run': [], 'total': 8}, 'players': {'tom': 0, 'kathy': 0}, 'played_cards': {'kathy': [], 'tom': []}, 'scoring_stats': {'tom': {'a_play': 0, 'b_hand': 0, 'c_crib': 0}, 'kathy': {'a_play': 0, 'b_hand': 0, 'c_crib': 0}}, 'state': 'PLAY', 'turn': 'kathy', 'winning_score': 121}
    fake_redis.set('test', json.dumps(game_dict))
    bev.cache = fake_redis
    seven_of_clubs = 'c6f4900f82'
    (just_won, points, points_source) = bev.score_play('test', 'kathy', seven_of_clubs)
    assert (not just_won)
    bev.record_play('test', 'kathy', seven_of_clubs)
    g = json.loads(fake_redis.get('test'))
    assert (g['players']['kathy'] == 2)
    assert (g['pegging']['total'] == 15)
    assert (set(g['pegging']['cards']) == set(['4de6b73ab8', 'c6f4900f82']))
    assert (g['hands']['kathy'] == ['EXAMPLE_KEY'])