def test_unregister_no_account(self):
    mocked_storage = mock.MagicMock()
    mocked_storage.find_all.return_value = []
    self.mocks['account'].AccountFileStorage.return_value = mocked_storage
    cb_client = mock.MagicMock()
    self.mocks['client'].Client.return_value = cb_client
    config = mock.MagicMock()
    unused_plugins = mock.MagicMock()
    res = main.unregister(config, unused_plugins)
    m = 'Could not find existing account to deactivate.'
    self.assertEqual(res, m)
    self.assertFalse(cb_client.acme.deactivate_registration.called)
def test_unregister_no_account(self):
    mocked_storage = mock.MagicMock()
    mocked_storage.find_all.return_value = []
    self.mocks['account'].AccountFileStorage.return_value = mocked_storage
    cb_client = mock.MagicMock()
    self.mocks['client'].Client.return_value = cb_client
    config = mock.MagicMock()
    unused_plugins = mock.MagicMock()
    res = main.unregister(config, unused_plugins)
    m = 'Could not find existing account to deactivate.'
    self.assertEqual(res, m)
    self.assertFalse(cb_client.acme.deactivate_registration.called)