From 19f760450f80690c3e02a99d4d360abbb8f095a7 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sat, 21 Jul 2012 13:28:59 +0200 Subject: [PATCH] Use local `httpbin` for all tests if available. --- README.rst | 2 +- tests/tests.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 3bbf6df4..9505e97f 100644 --- a/README.rst +++ b/README.rst @@ -46,7 +46,7 @@ Or, you can install the **development version** directly from GitHub: There are packages available for `Ubuntu `_, `Debian `_ and -other possibly other major distros as well. +possibly other major distros as well. Usage diff --git a/tests/tests.py b/tests/tests.py index 53f70f09..0c89fd6d 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -15,14 +15,14 @@ To make it run faster and offline you can:: HTTPBIN_URL=http://localhost:5000 python setup.py test """ -import unittest -import argparse import os import sys -import tempfile import json -from requests.compat import is_py26, is_py3 +import tempfile +import unittest +import argparse from requests import Response +from requests.compat import is_py26, is_py3 ################################################################# @@ -263,7 +263,7 @@ class AutoContentTypeAndAcceptHeadersTest(BaseTestCase): r = http( 'GET', - 'httpbin.org/get', + httpbin('/get'), env=Environment(stdout_isatty=False) ) self.assertNotIn('HTTP/', r) @@ -273,7 +273,7 @@ class AutoContentTypeAndAcceptHeadersTest(BaseTestCase): r = http( '--print=h', 'GET', - 'httpbin.org/get', + httpbin('/get'), env=Environment(stdout_isatty=False) ) self.assertIn('HTTP/1.1 200', r) @@ -460,7 +460,7 @@ class AuthTest(BaseTestCase): '--auth', 'user:password', 'GET', - 'httpbin.org/basic-auth/user/password' + httpbin('/basic-auth/user/password') ) self.assertIn('HTTP/1.1 200', r) self.assertIn('"authenticated": true', r) @@ -472,7 +472,7 @@ class AuthTest(BaseTestCase): '--auth', 'user:password', 'GET', - 'httpbin.org/digest-auth/auth/user/password' + httpbin('/digest-auth/auth/user/password') ) self.assertIn('HTTP/1.1 200', r) self.assertIn('"authenticated": true', r) @@ -486,7 +486,7 @@ class AuthTest(BaseTestCase): '--auth', 'user', 'GET', - 'httpbin.org/basic-auth/user/password' + httpbin('/basic-auth/user/password') ) self.assertIn('HTTP/1.1 200', r)