Skip to content
Myr

use gunicorn to serve tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 6e840f4 · Browse files · 1 file+11 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−8 removed

  • other:+11 added−8 removed

1 file+11 added−8 removed

modified:test_requests.py+11 added-8 removed
1 unmodified line
2# -*- coding: utf-8 -*-34from __future__ import with_statement56import unittest6import time7import cookielib8import unittest910import envoy1112try:13 import omnijson as json14except ImportError:15 import json
2 unmodified lines
1819from requests.sessions import Session202119HTTPBIN_URL = 'http://127.0.0.1:44444/'22HTTPBIN_URL = 'http://0.0.0.0:7045/'23# HTTPBIN_URL = 'http://127.0.0.1:8000/'242526def httpbin(*suffix):27 """Returns url for HTTPBIN resource."""
15 unmodified lines
4344 global _httpbin4546 if not _httpbin:43 import envoy44 self.httpbin = envoy.connect('httpbin 44444')45 # print self.httpbin4747 _httpbin = True48 # print '!'/48 self.httpbin = envoy.connect('gunicorn httpbin:app --bind=0.0.0.0:7045')4950 import time50 _httpbin = True51 time.sleep(1)525354
66 unmodified lines
121122123 def test_HTTP_200_OK_PATCH(self):124 r = requests.patch(httpbin('patch'))125 print r.__dict__126 print r.content127 print r.url128 self.assertEqual(r.status_code, 200)129130131 def test_AUTH_HTTP_200_OK_GET(self):
350 unmodified lines