From 0bc4c3611e4d849e720a35a6de3ff816d4d7e1a1 Mon Sep 17 00:00:00 2001 From: dmb23 <35734847+dmb23@users.noreply.github.com> Date: Tue, 26 Jul 2022 13:16:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Exception=20when=20all=20tasks?= =?UTF-8?q?=20are=20done=20(#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: rename default for bar.finished_style * add test for finished progress bar * apply linting rules --- pls_cli/please.py | 2 +- tests/test_pls_cli.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pls_cli/please.py b/pls_cli/please.py index c6ba287..5a83464 100644 --- a/pls_cli/please.py +++ b/pls_cli/please.py @@ -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: diff --git a/tests/test_pls_cli.py b/tests/test_pls_cli.py index 8fb36a6..8f44b70 100644 --- a/tests/test_pls_cli.py +++ b/tests/test_pls_cli.py @@ -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={