Skip to content

Instantly share code, notes, and snippets.

View digitamo's full-sized avatar
:octocat:

osama khaled saa'd digitamo

:octocat:
View GitHub Profile
@digitamo
digitamo / test_simple.py
Created August 9, 2016 14:12 — forked from kgriffs/test_simple.py
Simple Falcon testing example
import falcon
import falcon.testing as testing
QUOTE = (u"\nI've always been more interested in\n"
u'the future than in the past.\n'
u'\n'
u' ~ Grace Hopper\n\n')
class ThingsResource(object):
def on_get(self, req, resp):
@digitamo
digitamo / sample.py
Created August 9, 2016 14:12 — forked from kgriffs/sample.py
Sample unittest-style tests for a Falcon app
class TestAPI(falcon.testing.TestCase):
def setUp(self):
super(TestAPI, self).setUp()
env = os.environ.copy()
env['AS_SERVER_CERT'] = ''
env['AS_SERVER_KEY'] = ''
env['AS_CA_CERT'] = ''
var reducePath = function (x, y, entryOffset, rangeOffset, entryRequiredWall, entryDisallowedWall) {
var rangeEntryRequiredDirections = [entryDisallowedWall, OppositeDirections[entryDisallowedWall]];
var rangeEntryDisallowedDirections = [entryRequiredWall, OppositeDirections[entryRequiredWall]];
var endDisallowedDirections = [OppositeDirections[entryRequiredWall], OppositeDirections[entryDisallowedWall]];
var endRequiredDirections = [entryRequiredWall, entryDisallowedWall];
var tile = tiles[x][y];
var color = tile.color;
var entry = tiles[x+entryOffset[0]][y+entryOffset[1]];