From 6ceaca4a9d26c87c732329b149a7f7301fe22ad0 Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Wed, 25 May 2016 14:11:43 -0700 Subject: [PATCH] Minor test updates for update_registration call change --- certbot/tests/cli_test.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index 4dfc78792..007675759 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -947,25 +947,18 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods mocked_storage = mock.MagicMock() mocked_account.AccountFileStorage.return_value = mocked_storage mocked_storage.find_all.return_value = ["an account"] - mocked_det.return_value = ("a", "b") + mocked_det.return_value = (mock.MagicMock(), "foo") acme_client = mock.MagicMock() mocked_client.Client.return_value = acme_client - # Currently the update_registration() call always - # raises a harmless acme_errors.UnexpectedUpdate. - # If this is fixed, we should get rid of both this - # side effect and the corresponding try/catch in - # main.register(). - uu = acme_errors.UnexpectedUpdate - acme_client.acme.update_registration.side_effect = uu x = self._call_no_clientmock( ["register", "--update-registration", "--email", "user@example.org"]) # When registration change succeeds, the return value # of register() is None assert x[0] is None - # and we got far enough to query the registration from + # and we got supposedly did update the registration from # the server - assert acme_client.acme.query_registration.call_count == 1 + assert acme_client.acme.update_registration.call_count == 1 class DetermineAccountTest(unittest.TestCase):