Skip to content

Commit

Permalink
Add --verify true/false tests and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbrzt committed Feb 16, 2017
1 parent cf8d5eb commit 7321b9f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.

`1.0.0-dev`_ (unreleased)
-------------------------
* ``--verify`` now accepts ``true``/``false`` in addition to ``yes``/``no``
and the boolean value is case-insensitive.

`0.9.8`_ (2016-12-08)
---------------------
Expand Down
2 changes: 1 addition & 1 deletion httpie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
HTTPie - a CLI, cURL-like tool for humans.
"""
__author__ = 'Jakub Roztocil'
__version__ = '1.0.0-dev'
__author__ = 'Jakub Roztocil'
__licence__ = 'BSD'


Expand Down
8 changes: 4 additions & 4 deletions httpie/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,10 @@ def __iter__(self):
'--verify',
default='yes',
help="""
Set to "no" to skip checking the host's SSL certificate. You can also pass
the path to a CA_BUNDLE file for private certs. You can also set the
REQUESTS_CA_BUNDLE environment variable. Defaults to "yes".
Set to "no" (or "false") to skip checking the host's SSL certificate.
Defaults to "yes" ("true"). You can also pass the path to a CA_BUNDLE file
for private certs. (Or you can set the REQUESTS_CA_BUNDLE environment
variable instead.)
"""
)
ssl.add_argument(
Expand Down
5 changes: 5 additions & 0 deletions tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def test_verify_no_OK(self, httpbin_secure):
r = http(httpbin_secure.url + '/get', '--verify=no')
assert HTTP_OK in r

@pytest.mark.parametrize('verify_value', ['false', 'fALse'])
def test_verify_false_OK(self, httpbin_secure, verify_value):
r = http(httpbin_secure.url + '/get', '--verify', verify_value)
assert HTTP_OK in r

def test_verify_custom_ca_bundle_path(
self, httpbin_secure_untrusted):
r = http(httpbin_secure_untrusted + '/get', '--verify', CA_BUNDLE)
Expand Down

0 comments on commit 7321b9f

Please sign in to comment.