Skip to content

Commit

Permalink
Adjust tests to with statement
Browse files Browse the repository at this point in the history
  • Loading branch information
fupduck committed Jun 20, 2024
1 parent 8a4e674 commit 0cef292
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion certbot_dns_hetzner/dns_hetzner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ def setUp(self):
self.auth = Authenticator(self.config, "hetzner")

self.mock_client = mock.MagicMock()

mock_client_wrapper = mock.MagicMock()
mock_client_wrapper.__enter__ = mock.MagicMock(
return_value=self.mock_client
)

# _get_ispconfig_client | pylint: disable=protected-access
self.auth._get_hetzner_client = mock.MagicMock(
return_value=self.mock_client)
return_value=mock_client_wrapper
)

@patch_display_util()
def test_perform(self, _unused_mock_get_utility):
Expand Down

0 comments on commit 0cef292

Please sign in to comment.