1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Add --sorted

Also add --no-(sorted|unsorted) to allow the documented resetting to default via --no-<option>.
This commit is contained in:
Jakub Roztocil
2020-06-16 12:54:50 +02:00
parent 23dd80563f
commit 8a106781be
4 changed files with 167 additions and 104 deletions

View File

@@ -298,6 +298,40 @@ class TestFormatOptions:
],
PARSED_DEFAULT_FORMAT_OPTIONS,
),
(
[
'--format-options=json.indent:2',
'--unsorted',
'--no-unsorted',
],
{
'headers': {'sort': True},
'json': {'sort_keys': True, 'indent': 2, 'format': True},
}
),
(
[
'--format-options=json.indent:2',
'--unsorted',
'--sorted',
],
{
'headers': {'sort': True},
'json': {'sort_keys': True, 'indent': 2, 'format': True},
}
),
(
[
'--format-options=json.indent:2',
'--sorted',
'--no-sorted',
'--no-unsorted',
],
{
'headers': {'sort': True},
'json': {'sort_keys': True, 'indent': 2, 'format': True},
}
),
],
)
def test_format_options_accumulation(self, args, expected_format_options):