Skip to content

Commit

Permalink
🐛 Exception when all tasks are done (#16)
Browse files Browse the repository at this point in the history
* fix: rename default for bar.finished_style

* add test for finished progress bar

* apply linting rules
  • Loading branch information
dmb23 authored Jul 26, 2022
1 parent 0f80f59 commit 0bc4c36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pls_cli/please.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

background_bar_style = os.getenv('PLS_BACKGROUND_BAR_STYLE', 'bar.back')
complete_bar_style = os.getenv('PLS_COMPLETE_BAR_STYLE', 'bar.complete')
finished_bar_style = os.getenv('PLS_FINISHED_BAR_STYLE', 'bar.done')
finished_bar_style = os.getenv('PLS_FINISHED_BAR_STYLE', 'bar.finished')


def get_terminal_full_width() -> int:
Expand Down
12 changes: 12 additions & 0 deletions tests/test_pls_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def test_config_ok_no_tasks_pending(
assert 'Looking good, no pending tasks ✨ 🍰 ✨' in result.stdout


@patch('pls_cli.utils.settings.Settings.exists_settings', return_value=True)
@patch(
'pls_cli.utils.settings.Settings.get_tasks',
return_value=[{'name': 'Task 1', 'done': True}],
)
def test_config_ok_no_tasks_pending_with_progress(
mock_get_tasks, mock_exists_settings
):
result = runner.invoke(app)
assert result.exit_code == 0


@patch(
'pls_cli.utils.settings.Settings.get_settings',
return_value={
Expand Down

0 comments on commit 0bc4c36

Please sign in to comment.