This commit is contained in:
Jakub Roztocil 2020-06-16 13:01:48 +02:00
parent 8a106781be
commit d35864e79d
3 changed files with 56 additions and 21 deletions

View File

@ -9,15 +9,15 @@ This project adheres to `Semantic Versioning <https://semver.org/>`_.
`2.2.0-dev`_ (unreleased) `2.2.0-dev`_ (unreleased)
------------------------- -------------------------
* Fixed built-in plugins-related circular imports (`#925`_).
* Added ``--ciphers`` to allow configuring OpenSSL ciphers (`#870`_).
* Added support for ``$XDG_CONFIG_HOME`` (`#920`_).
* Added support for custom content types for uploaded files (`#668`_). * Added support for custom content types for uploaded files (`#668`_).
* Added support for ``$XDG_CONFIG_HOME`` (`#920`_).
* Added support for ``Set-Cookie``-triggered cookie expiration (`#853`_). * Added support for ``Set-Cookie``-triggered cookie expiration (`#853`_).
* Added ``--format-options`` to allow disabling sorting, etc. (`#128`_) * Added ``--format-options`` to allow disabling sorting, etc. (`#128`_)
* Added ``--sorted`` and ``--unsorted`` shortcuts for (un)setting all sorting-related ``--format-options``. (`#128`_) * Added ``--sorted`` and ``--unsorted`` shortcuts for (un)setting all sorting-related ``--format-options``. (`#128`_)
* Added ``netrc`` support for auth plugins. * Added ``--ciphers`` to allow configuring OpenSSL ciphers (`#870`_).
Enabled for ``--auth-type=basic`` and ``digest``, 3rd parties may opt in (`#718`_, `#719`_, `#852`_, `#934`_). * Added ``netrc`` support for auth plugins. Enabled for ``--auth-type=basic``
and ``digest``, 3rd parties may opt in (`#718`_, `#719`_, `#852`_, `#934`_).
* Fixed built-in plugins-related circular imports (`#925`_).
`2.1.0`_ (2020-04-18) `2.1.0`_ (2020-04-18)

View File

@ -1,7 +1,7 @@
''' """
CLI arguments definition. CLI arguments definition.
''' """
from argparse import (FileType, OPTIONAL, SUPPRESS, ZERO_OR_MORE) from argparse import (FileType, OPTIONAL, SUPPRESS, ZERO_OR_MORE)
from textwrap import dedent, wrap from textwrap import dedent, wrap

View File

@ -6,12 +6,11 @@ from urllib.request import urlopen
import pytest import pytest
from httpie.cli.constants import DEFAULT_FORMAT_OPTIONS
from httpie.cli.definition import parser
from httpie.cli.argtypes import ( from httpie.cli.argtypes import (
PARSED_DEFAULT_FORMAT_OPTIONS, PARSED_DEFAULT_FORMAT_OPTIONS,
parse_format_options, parse_format_options,
) )
from httpie.cli.definition import parser
from httpie.output.formatters.colors import get_lexer from httpie.output.formatters.colors import get_lexer
from httpie.status import ExitStatus from httpie.status import ExitStatus
from utils import COLOR, CRLF, HTTP_OK, MockEnvironment, http from utils import COLOR, CRLF, HTTP_OK, MockEnvironment, http
@ -265,8 +264,14 @@ class TestFormatOptions:
'--format-options=json.indent:10' '--format-options=json.indent:10'
], ],
{ {
'headers': {'sort': False}, 'headers': {
'json': {'sort_keys': False, 'indent': 10, 'format': True}, 'sort': False
},
'json': {
'sort_keys': False,
'indent': 10,
'format': True
},
} }
), ),
( (
@ -274,8 +279,14 @@ class TestFormatOptions:
'--unsorted' '--unsorted'
], ],
{ {
'headers': {'sort': False}, 'headers': {
'json': {'sort_keys': False, 'indent': 4, 'format': True}, 'sort': False
},
'json': {
'sort_keys': False,
'indent': 4,
'format': True
},
} }
), ),
( (
@ -285,8 +296,14 @@ class TestFormatOptions:
'--format-options=headers.sort:true', '--format-options=headers.sort:true',
], ],
{ {
'headers': {'sort': True}, 'headers': {
'json': {'sort_keys': False, 'indent': 4, 'format': True}, 'sort': True
},
'json': {
'sort_keys': False,
'indent': 4,
'format': True
},
} }
), ),
( (
@ -305,8 +322,14 @@ class TestFormatOptions:
'--no-unsorted', '--no-unsorted',
], ],
{ {
'headers': {'sort': True}, 'headers': {
'json': {'sort_keys': True, 'indent': 2, 'format': True}, 'sort': True
},
'json': {
'sort_keys': True,
'indent': 2,
'format': True
},
} }
), ),
( (
@ -316,8 +339,14 @@ class TestFormatOptions:
'--sorted', '--sorted',
], ],
{ {
'headers': {'sort': True}, 'headers': {
'json': {'sort_keys': True, 'indent': 2, 'format': True}, 'sort': True
},
'json': {
'sort_keys': True,
'indent': 2,
'format': True
},
} }
), ),
( (
@ -328,8 +357,14 @@ class TestFormatOptions:
'--no-unsorted', '--no-unsorted',
], ],
{ {
'headers': {'sort': True}, 'headers': {
'json': {'sort_keys': True, 'indent': 2, 'format': True}, 'sort': True
},
'json': {
'sort_keys': True,
'indent': 2,
'format': True
},
} }
), ),
], ],