Skip to content

Instantly share code, notes, and snippets.

@aswearin
aswearin / Coursera_BlackJack_InProgress.txt
Last active September 28, 2015 23:26
Coursera Week 6 mini-project - in progress - suggestions welcome
# Mini-project #6 - Blackjack
#codeskulptor URL http://www.codeskulptor.org/#user40_OeuznosqZM_6., http://www.codeskulptor.org/#user40_Mc8uD9d4lL_3.py
import simplegui
import random
# load card sprite - 936x384 - source: jfitz.com
CARD_SIZE = (72, 96)
@aswearin
aswearin / def urlopen_latest_commit_side_effect
Created July 14, 2015 18:50
what the heck is the matter here?
def urlopen_latest_commit_side_effect(self, *args, **kwargs):
if len(args) > 0:
uri = args[0].get_full_url()
print uri
else:
raise Exception('Unexpected call to urlopen by mock object')
if uri == 'https://api.github.com/repos/summon/Content.xquery-test/git/refs/heads/release-ready-test':
return file("test_github_data/json_response")
elif uri == 'https://api.github.com/repos/summon/Content.xquery404/git/refs/heads/return-404':
raise HTTPError(uri, 404, 'Not Found', None, None)