mirror of
https://github.com/httpie/cli.git
synced 2025-06-24 19:41:23 +02:00
Use local httpbin
for all tests if available.
This commit is contained in:
parent
35da44309f
commit
19f760450f
@ -46,7 +46,7 @@ Or, you can install the **development version** directly from GitHub:
|
|||||||
There are packages available for
|
There are packages available for
|
||||||
`Ubuntu <http://packages.ubuntu.com/httpie>`_,
|
`Ubuntu <http://packages.ubuntu.com/httpie>`_,
|
||||||
`Debian <http://packages.debian.org/httpie>`_ and
|
`Debian <http://packages.debian.org/httpie>`_ and
|
||||||
other possibly other major distros as well.
|
possibly other major distros as well.
|
||||||
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
|
@ -15,14 +15,14 @@ To make it run faster and offline you can::
|
|||||||
HTTPBIN_URL=http://localhost:5000 python setup.py test
|
HTTPBIN_URL=http://localhost:5000 python setup.py test
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import unittest
|
|
||||||
import argparse
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
|
||||||
import json
|
import json
|
||||||
from requests.compat import is_py26, is_py3
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
import argparse
|
||||||
from requests import Response
|
from requests import Response
|
||||||
|
from requests.compat import is_py26, is_py3
|
||||||
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
@ -263,7 +263,7 @@ class AutoContentTypeAndAcceptHeadersTest(BaseTestCase):
|
|||||||
|
|
||||||
r = http(
|
r = http(
|
||||||
'GET',
|
'GET',
|
||||||
'httpbin.org/get',
|
httpbin('/get'),
|
||||||
env=Environment(stdout_isatty=False)
|
env=Environment(stdout_isatty=False)
|
||||||
)
|
)
|
||||||
self.assertNotIn('HTTP/', r)
|
self.assertNotIn('HTTP/', r)
|
||||||
@ -273,7 +273,7 @@ class AutoContentTypeAndAcceptHeadersTest(BaseTestCase):
|
|||||||
r = http(
|
r = http(
|
||||||
'--print=h',
|
'--print=h',
|
||||||
'GET',
|
'GET',
|
||||||
'httpbin.org/get',
|
httpbin('/get'),
|
||||||
env=Environment(stdout_isatty=False)
|
env=Environment(stdout_isatty=False)
|
||||||
)
|
)
|
||||||
self.assertIn('HTTP/1.1 200', r)
|
self.assertIn('HTTP/1.1 200', r)
|
||||||
@ -460,7 +460,7 @@ class AuthTest(BaseTestCase):
|
|||||||
'--auth',
|
'--auth',
|
||||||
'user:password',
|
'user:password',
|
||||||
'GET',
|
'GET',
|
||||||
'httpbin.org/basic-auth/user/password'
|
httpbin('/basic-auth/user/password')
|
||||||
)
|
)
|
||||||
self.assertIn('HTTP/1.1 200', r)
|
self.assertIn('HTTP/1.1 200', r)
|
||||||
self.assertIn('"authenticated": true', r)
|
self.assertIn('"authenticated": true', r)
|
||||||
@ -472,7 +472,7 @@ class AuthTest(BaseTestCase):
|
|||||||
'--auth',
|
'--auth',
|
||||||
'user:password',
|
'user:password',
|
||||||
'GET',
|
'GET',
|
||||||
'httpbin.org/digest-auth/auth/user/password'
|
httpbin('/digest-auth/auth/user/password')
|
||||||
)
|
)
|
||||||
self.assertIn('HTTP/1.1 200', r)
|
self.assertIn('HTTP/1.1 200', r)
|
||||||
self.assertIn('"authenticated": true', r)
|
self.assertIn('"authenticated": true', r)
|
||||||
@ -486,7 +486,7 @@ class AuthTest(BaseTestCase):
|
|||||||
'--auth',
|
'--auth',
|
||||||
'user',
|
'user',
|
||||||
'GET',
|
'GET',
|
||||||
'httpbin.org/basic-auth/user/password'
|
httpbin('/basic-auth/user/password')
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertIn('HTTP/1.1 200', r)
|
self.assertIn('HTTP/1.1 200', r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user