mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 05:48:01 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
0eba037037 | |||
3898129e9c | |||
b88e88d2e3 | |||
d1407baf76 |
@ -6,6 +6,18 @@ This document records all notable changes to `HTTPie <http://httpie.org>`_.
|
||||
This project adheres to `Semantic Versioning <http://semver.org/>`_.
|
||||
|
||||
|
||||
`1.0.3-dev`_ (unreleased)
|
||||
-------------------------
|
||||
|
||||
* No changes yet.
|
||||
|
||||
|
||||
`1.0.2`_ (2018-11-14)
|
||||
-------------------------
|
||||
|
||||
* Fixed tests for installation with pyOpenSSL.
|
||||
|
||||
|
||||
`1.0.1`_ (2018-11-14)
|
||||
-------------------------
|
||||
|
||||
@ -314,13 +326,13 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
|
||||
* Many improvements and bug fixes
|
||||
|
||||
|
||||
`0.1`_ (2012-02-25)
|
||||
-------------------
|
||||
`0.1.0`_ (2012-02-25)
|
||||
---------------------
|
||||
|
||||
* Initial public release
|
||||
|
||||
|
||||
.. _`0.1`: https://github.com/jakubroztocil/httpie/commit/b966efa
|
||||
.. _`0.1.0`: https://github.com/jakubroztocil/httpie/commit/b966efa
|
||||
.. _0.1.4: https://github.com/jakubroztocil/httpie/compare/b966efa...0.1.4
|
||||
.. _0.1.5: https://github.com/jakubroztocil/httpie/compare/0.1.4...0.1.5
|
||||
.. _0.1.6: https://github.com/jakubroztocil/httpie/compare/0.1.5...0.1.6
|
||||
@ -348,3 +360,5 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
|
||||
.. _0.9.9: https://github.com/jakubroztocil/httpie/compare/0.9.8...0.9.9
|
||||
.. _1.0.0: https://github.com/jakubroztocil/httpie/compare/0.9.9...1.0.0
|
||||
.. _1.0.1: https://github.com/jakubroztocil/httpie/compare/1.0.0...1.0.1
|
||||
.. _1.0.2: https://github.com/jakubroztocil/httpie/compare/1.0.1...1.0.2
|
||||
.. _1.0.3-dev: https://github.com/jakubroztocil/httpie/compare/1.0.2...master
|
||||
|
15
Makefile
15
Makefile
@ -124,6 +124,21 @@ uninstall-all: uninstall-httpie
|
||||
- pip uninstall --yes -r $(REQUIREMENTS)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Docs
|
||||
###############################################################################
|
||||
|
||||
pdf:
|
||||
# NOTE: rst2pdf needs to be installed manually and against a Python 2
|
||||
@echo "Converting README.rst to PDF…"
|
||||
rst2pdf \
|
||||
--strip-elements-with-class=no-pdf \
|
||||
README.rst \
|
||||
-o README.pdf
|
||||
@echo "Done"
|
||||
@echo
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Utils
|
||||
###############################################################################
|
||||
|
@ -134,6 +134,9 @@ You can also install the latest unreleased development version directly from
|
||||
the ``master`` branch on GitHub. It is a work-in-progress of a future stable
|
||||
release so the experience might be not as smooth.
|
||||
|
||||
|
||||
.. class:: no-pdf
|
||||
|
||||
|unix_build|
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
HTTPie - a CLI, cURL-like tool for humans.
|
||||
|
||||
"""
|
||||
__version__ = '1.0.1'
|
||||
__version__ = '1.0.2'
|
||||
__author__ = 'Jakub Roztocil'
|
||||
__licence__ = 'BSD'
|
||||
|
||||
|
@ -2,17 +2,31 @@ import os
|
||||
|
||||
import pytest
|
||||
import pytest_httpbin.certs
|
||||
from requests.exceptions import SSLError
|
||||
import requests.exceptions
|
||||
|
||||
from httpie import ExitStatus
|
||||
from httpie.input import SSL_VERSION_ARG_MAPPING
|
||||
from utils import http, HTTP_OK, TESTS_ROOT
|
||||
from utils import HTTP_OK, TESTS_ROOT, http
|
||||
|
||||
|
||||
try:
|
||||
# Handle OpenSSL errors, if installed.
|
||||
# See <https://github.com/jakubroztocil/httpie/issues/729>
|
||||
# noinspection PyUnresolvedReferences
|
||||
import OpenSSL.SSL
|
||||
ssl_errors = (
|
||||
requests.exceptions.SSLError,
|
||||
OpenSSL.SSL.Error,
|
||||
)
|
||||
except ImportError:
|
||||
ssl_errors = (
|
||||
requests.exceptions.SSLError,
|
||||
)
|
||||
|
||||
|
||||
CLIENT_CERT = os.path.join(TESTS_ROOT, 'client_certs', 'client.crt')
|
||||
CLIENT_KEY = os.path.join(TESTS_ROOT, 'client_certs', 'client.key')
|
||||
CLIENT_PEM = os.path.join(TESTS_ROOT, 'client_certs', 'client.pem')
|
||||
|
||||
# FIXME:
|
||||
# We test against a local httpbin instance which uses a self-signed cert.
|
||||
# Requests without --verify=<CA_BUNDLE> will fail with a verification error.
|
||||
@ -28,7 +42,7 @@ def test_ssl_version(httpbin_secure, ssl_version):
|
||||
httpbin_secure + '/get'
|
||||
)
|
||||
assert HTTP_OK in r
|
||||
except SSLError as e:
|
||||
except ssl_errors as e:
|
||||
if ssl_version == 'ssl3':
|
||||
# pytest-httpbin doesn't support ssl3
|
||||
assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in str(e)
|
||||
@ -57,12 +71,12 @@ class TestClientCert:
|
||||
assert 'No such file or directory' in r.stderr
|
||||
|
||||
def test_cert_file_invalid(self, httpbin_secure):
|
||||
with pytest.raises(SSLError):
|
||||
with pytest.raises(ssl_errors):
|
||||
http(httpbin_secure + '/get',
|
||||
'--cert', __file__)
|
||||
|
||||
def test_cert_ok_but_missing_key(self, httpbin_secure):
|
||||
with pytest.raises(SSLError):
|
||||
with pytest.raises(ssl_errors):
|
||||
http(httpbin_secure + '/get',
|
||||
'--cert', CLIENT_CERT)
|
||||
|
||||
@ -79,21 +93,23 @@ class TestServerCert:
|
||||
assert HTTP_OK in r
|
||||
|
||||
def test_verify_custom_ca_bundle_path(
|
||||
self, httpbin_secure_untrusted):
|
||||
self, httpbin_secure_untrusted
|
||||
):
|
||||
r = http(httpbin_secure_untrusted + '/get', '--verify', CA_BUNDLE)
|
||||
assert HTTP_OK in r
|
||||
|
||||
def test_self_signed_server_cert_by_default_raises_ssl_error(
|
||||
self,
|
||||
httpbin_secure_untrusted):
|
||||
with pytest.raises(SSLError):
|
||||
self,
|
||||
httpbin_secure_untrusted
|
||||
):
|
||||
with pytest.raises(ssl_errors):
|
||||
http(httpbin_secure_untrusted.url + '/get')
|
||||
|
||||
def test_verify_custom_ca_bundle_invalid_path(self, httpbin_secure):
|
||||
# since 2.14.0 requests raises IOError
|
||||
with pytest.raises((SSLError, IOError)):
|
||||
with pytest.raises(ssl_errors + (IOError,)):
|
||||
http(httpbin_secure.url + '/get', '--verify', '/__not_found__')
|
||||
|
||||
def test_verify_custom_ca_bundle_invalid_bundle(self, httpbin_secure):
|
||||
with pytest.raises(SSLError):
|
||||
with pytest.raises(ssl_errors):
|
||||
http(httpbin_secure.url + '/get', '--verify', __file__)
|
||||
|
Reference in New Issue
Block a user