Skip to content

Commit

Permalink
This is why you test :D
Browse files Browse the repository at this point in the history
  • Loading branch information
glasnt committed Oct 25, 2020
1 parent 3e86c59 commit d92a17b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ih/cli.py
Expand Up @@ -10,7 +10,7 @@
"-p",
default=chart.DEFAULT["palette"],
show_default=True,
type=click.Choice(palette.PALETTES),
type=click.Choice(palette.PALETTES + list(palette.PALETTE_OVERRIDE.keys())),
help="Palette to use. See README.md for provenance",
)
@click.option(
Expand Down
2 changes: 1 addition & 1 deletion ih/palette.py
Expand Up @@ -54,7 +54,7 @@ def get_thread_image(palette_name):

def get_palette(palette_name):
if palette_name in PALETTE_OVERRIDE.keys():
palette = PALETTE_OVERRIDE[palette_name]
palette_name = PALETTE_OVERRIDE[palette_name]

if palette_name not in PALETTES:
raise ValueError(
Expand Down
15 changes: 14 additions & 1 deletion tests/test_cli.py
Expand Up @@ -10,7 +10,7 @@
def runner(args, output=TEST_HTML, print_output=False):
runner = CliRunner()
result = runner.invoke(main, [TEST_IMAGE] + args)
if print_output:
if print_output:
print(result.output)
assert result.exit_code == 0
assert output in result.output
Expand All @@ -33,8 +33,21 @@ def test_guidelines():
runner(["-g"])


def test_thread():
runner(["-p", "馃У"])


def test_alpaca():
runner(["-p", "馃"])


def test_wool():
runner(["-p", "馃Ф"])


def test_term():
runner(["-o", "term"], output="ih version")


def test_term_render():
runner(["-o", "term", "-r"], output="ih version", print_output=True)

0 comments on commit d92a17b

Please sign in to comment.