From c3d3cbff672f232bb109cf4ae3d0ae66ae22fe0d Mon Sep 17 00:00:00 2001 From: ali ugur Date: Tue, 6 Aug 2024 09:37:07 +0300 Subject: [PATCH] Initialized test fail parameter and updated docstring --- tests/unit/test_charm.py | 2 +- tests/unit/wordpress_mock.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index 9b00b4bd..7413bd45 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -502,7 +502,7 @@ def test_update_database_fail( action_event_mock: unittest.mock.MagicMock, ): """ - arrange: after charm is initialized and database is not ready. + arrange: after charm is initialized and database is mocked to fail. act: run update-database action. assert: update-database action should fail. """ diff --git a/tests/unit/wordpress_mock.py b/tests/unit/wordpress_mock.py index 6d8d3edf..9283f27c 100644 --- a/tests/unit/wordpress_mock.py +++ b/tests/unit/wordpress_mock.py @@ -359,6 +359,7 @@ def __init__( self._wordpress_database_mock = wordpress_database_mock self.installed_plugins = set(WordpressCharm._WORDPRESS_DEFAULT_PLUGINS) self.installed_themes = set(WordpressCharm._WORDPRESS_DEFAULT_THEMES) + self._fail_wp_update_database = False def exec( self, cmd, user=None, group=None, working_dir=None, combine_stderr=None, timeout=None