Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpie/output/formatters/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,4 @@ def make_styles():

PIE_STYLES = make_styles()
PIE_STYLE_NAMES = list(PIE_STYLES.keys())
BUNDLED_STYLES |= PIE_STYLES.keys()
BUNDLED_STYLES |= {style.value for style in PIE_STYLES}
11 changes: 11 additions & 0 deletions tests/test_cli_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ def fake_terminal_size(*args, **kwargs):
def test_naked_invocation(ignore_terminal_size, args, expected_msg):
result = http(*args, tolerate_error_exit_status=True)
assert result.stderr == expected_msg


def test_invalid_style_lists_bundled_pie_styles_by_name():
result = http(
'--style', '$invalid', '--offline', 'pie.dev',
tolerate_error_exit_status=True,
)
assert 'invalid choice' in result.stderr
assert 'PieStyle' not in result.stderr
for name in ('pie', 'pie-dark', 'pie-light'):
assert name in result.stderr
Loading