Skip to content

Commit

Permalink
Don't print empty line when emoji not found (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Jan 20, 2025
2 parents 6bb70de + bb1376d commit 53a05f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/em_keyboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def cli() -> None:
copied = try_copy_to_clipboard(results)
else:
copied = False
print(f"Copied! {print_results}" if copied else print_results)

if print_results:
print(f"Copied! {print_results}" if copied else print_results)

sys.exit(int(missing))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_em.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_not_found(mock_print: MagicMock, mock_argparse: MagicMock) -> None:
cli()

# Assert
mock_print.assert_called_once_with("")
mock_print.assert_not_called()
assert e.type is SystemExit
assert e.value.code == 1

Expand Down

0 comments on commit 53a05f1

Please sign in to comment.