def test_ip(ip_address, path='/country.js'): """Run a mock request against the service.""" application = load_geodude() request = Request.blank(path, remote_addr=ip_address) response = request.get_response(application) print response.status for header in response.headers: print header, ':', response.headers[header] print '\n', response.body
def runserver(port=8000): """Run a development instance of the geodude server.""" application = load_geodude() server = make_server('', int(port), application) print 'Serving HTTP on port {0}...'.format(port) try: server.serve_forever() except KeyboardInterrupt: print 'Exiting server...'