From ae660e1b0d7ca3100f1a476347d03ca8d242c5ce Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 28 Dec 2019 23:52:54 +0100 Subject: [PATCH] Improve coverage --- acme/acme/mixins.py | 6 +++--- acme/tests/client_test.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/acme/acme/mixins.py b/acme/acme/mixins.py index e676c1485..7b50c85dc 100644 --- a/acme/acme/mixins.py +++ b/acme/acme/mixins.py @@ -20,7 +20,7 @@ class VersionedLEACMEMixin(object): # Required for @property to operate properly. See comment above. object.__setattr__(self, key, value) else: - super(VersionedLEACMEMixin, self).__setattr__(key, value) + super(VersionedLEACMEMixin, self).__setattr__(key, value) # pragma: no cover class ResourceMixin(VersionedLEACMEMixin): @@ -36,7 +36,7 @@ class ResourceMixin(VersionedLEACMEMixin): jobj.pop('resource', None) return jobj - raise AttributeError('This class does not implement method to_partial_json().') + raise AttributeError('This class does not implement method to_partial_json().') # pragma: no cover class TypeMixin(VersionedLEACMEMixin): @@ -52,4 +52,4 @@ class TypeMixin(VersionedLEACMEMixin): jobj.pop('type', None) return jobj - raise AttributeError('This class does not implement method to_partial_json().') + raise AttributeError('This class does not implement method to_partial_json().') # pragma: no cover diff --git a/acme/tests/client_test.py b/acme/tests/client_test.py index 192cd2949..526e44f76 100644 --- a/acme/tests/client_test.py +++ b/acme/tests/client_test.py @@ -16,6 +16,7 @@ from acme import errors from acme import jws as acme_jws from acme import messages from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module +from acme.mixins import VersionedLEACMEMixin import messages_test import test_util @@ -899,7 +900,7 @@ class ClientV2Test(ClientTestBase): self.client.net.get.assert_called_once_with(self.authzr2.uri) -class MockJSONDeSerializable(jose.JSONDeSerializable): +class MockJSONDeSerializable(VersionedLEACMEMixin, jose.JSONDeSerializable): # pylint: disable=missing-docstring def __init__(self, value): self.value = value