Hello community, here is the log from the commit of package python-acme for openSUSE:Factory checked in at 2020-01-21 21:01:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-acme (Old) and /work/SRC/openSUSE:Factory/.python-acme.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-acme" Tue Jan 21 21:01:47 2020 rev:40 rq:766003 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-acme/python-acme.changes 2020-01-03 17:39:46.595381665 +0100 +++ /work/SRC/openSUSE:Factory/.python-acme.new.26092/python-acme.changes 2020-01-21 21:02:21.700904788 +0100 @@ -1,0 +2,10 @@ +Tue Jan 21 09:45:10 UTC 2020 - Marketa Calabkova <[email protected]> + +- update to version 1.1.0 + * Removed the fallback introduced with 0.34.0 in acme to retry a POST-as-GET + request as a GET request when the targeted ACME CA server seems to not support + POST-as-GET requests. + * Support for Python 3.4 in Certbot and its ACME library is deprecated and will be + removed in the next release of Certbot. + +------------------------------------------------------------------- Old: ---- acme-1.0.0.tar.gz acme-1.0.0.tar.gz.asc New: ---- acme-1.1.0.tar.gz acme-1.1.0.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-acme.spec ++++++ --- /var/tmp/diff_new_pack.Ssr40d/_old 2020-01-21 21:02:23.068905426 +0100 +++ /var/tmp/diff_new_pack.Ssr40d/_new 2020-01-21 21:02:23.072905428 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define libname acme Name: python-%{libname} -Version: 1.0.0 +Version: 1.1.0 Release: 0 Summary: Python library for the ACME protocol License: Apache-2.0 ++++++ acme-1.0.0.tar.gz -> acme-1.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/PKG-INFO new/acme-1.1.0/PKG-INFO --- old/acme-1.0.0/PKG-INFO 2019-12-03 18:20:41.000000000 +0100 +++ new/acme-1.1.0/PKG-INFO 2020-01-14 19:41:44.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: acme -Version: 1.0.0 +Version: 1.1.0 Summary: ACME protocol implementation in Python Home-page: https://github.com/letsencrypt/letsencrypt Author: Certbot Project diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/__init__.py new/acme-1.1.0/acme/__init__.py --- old/acme-1.0.0/acme/__init__.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/__init__.py 2020-01-14 19:41:31.000000000 +0100 @@ -13,7 +13,6 @@ # # It is based on # https://github.com/requests/requests/blob/1278ecdf71a312dc2268f3bfc0aabfab3c006dcf/requests/packages.py - import josepy as jose for mod in list(sys.modules): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/challenges.py new/acme-1.1.0/acme/challenges.py --- old/acme-1.0.0/acme/challenges.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/challenges.py 2020-01-14 19:41:31.000000000 +0100 @@ -54,8 +54,7 @@ object.__setattr__(self, "jobj", jobj) def to_partial_json(self): - # pylint: disable=no-member - return self.jobj + return self.jobj # pylint: disable=no-member @classmethod def from_json(cls, jobj): @@ -113,7 +112,7 @@ :rtype: bool """ - parts = self.key_authorization.split('.') # pylint: disable=no-member + parts = self.key_authorization.split('.') if len(parts) != 2: logger.debug("Key authorization (%r) is not well formed", self.key_authorization) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/client.py new/acme-1.1.0/acme/client.py --- old/acme-1.0.0/acme/client.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/client.py 2020-01-14 19:41:31.000000000 +0100 @@ -5,25 +5,26 @@ from email.utils import parsedate_tz import heapq import logging -import time import re import sys +import time -import six -from six.moves import http_client # pylint: disable=import-error import josepy as jose import OpenSSL import requests from requests.adapters import HTTPAdapter from requests_toolbelt.adapters.source import SourceAddressAdapter +import six +from six.moves import http_client # pylint: disable=import-error from acme import crypto_util from acme import errors from acme import jws from acme import messages -# pylint: disable=unused-import, no-name-in-module -from acme.magic_typing import Dict, List, Set, Text - +from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import Text # pylint: disable=unused-import, no-name-in-module logger = logging.getLogger(__name__) @@ -33,7 +34,6 @@ # https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning if sys.version_info < (2, 7, 9): # pragma: no cover try: - # pylint: disable=no-member requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3() # type: ignore except AttributeError: import urllib3.contrib.pyopenssl # pylint: disable=import-error @@ -279,7 +279,6 @@ assert response.status_code == http_client.CREATED # "Instance of 'Field' has no key/contact member" bug: - # pylint: disable=no-member return self._regr_from_response(response) def query_registration(self, regr): @@ -464,7 +463,6 @@ updated[authzr] = updated_authzr attempts[authzr] += 1 - # pylint: disable=no-member if updated_authzr.body.status not in ( messages.STATUS_VALID, messages.STATUS_INVALID): if attempts[authzr] < max_attempts: @@ -605,7 +603,6 @@ if response.status_code == 200 and 'Location' in response.headers: raise errors.ConflictError(response.headers.get('Location')) # "Instance of 'Field' has no key/contact member" bug: - # pylint: disable=no-member regr = self._regr_from_response(response) self.net.account = regr return regr @@ -729,7 +726,7 @@ for authzr in responses: if authzr.body.status != messages.STATUS_VALID: for chall in authzr.body.challenges: - if chall.error != None: + if chall.error is not None: failed.append(authzr) if failed: raise errors.ValidationError(failed) @@ -779,29 +776,13 @@ def _post_as_get(self, *args, **kwargs): """ - Send GET request using the POST-as-GET protocol if needed. - The request will be first issued using POST-as-GET for ACME v2. If the ACME CA servers do - not support this yet and return an error, request will be retried using GET. - For ACME v1, only GET request will be tried, as POST-as-GET is not supported. + Send GET request using the POST-as-GET protocol. :param args: :param kwargs: :return: """ - if self.acme_version >= 2: - # We add an empty payload for POST-as-GET requests - new_args = args[:1] + (None,) + args[1:] - try: - return self._post(*new_args, **kwargs) - except messages.Error as error: - if error.code == 'malformed': - logger.debug('Error during a POST-as-GET request, ' - 'your ACME CA server may not support it:\n%s', error) - logger.debug('Retrying request with GET.') - else: # pragma: no cover - raise - - # If POST-as-GET is not supported yet, we use a GET instead. - return self.net.get(*args, **kwargs) + new_args = args[:1] + (None,) + args[1:] + return self._post(*new_args, **kwargs) class BackwardsCompatibleClientV2(object): @@ -1124,10 +1105,9 @@ err_regex = r".*host='(\S*)'.*Max retries exceeded with url\: (\/\w*).*(\[Errno \d+\])([A-Za-z ]*)" m = re.match(err_regex, str(e)) if m is None: - raise # pragma: no cover - else: - host, path, _err_no, err_msg = m.groups() - raise ValueError("Requesting {0}{1}:{2}".format(host, path, err_msg)) + raise # pragma: no cover + host, path, _err_no, err_msg = m.groups() + raise ValueError("Requesting {0}{1}:{2}".format(host, path, err_msg)) # If content is DER, log the base64 of it instead of raw bytes, to keep # binary data out of the logs. @@ -1193,8 +1173,7 @@ if error.code == 'badNonce': logger.debug('Retrying request after error:\n%s', error) return self._post_once(*args, **kwargs) - else: - raise + raise def _post_once(self, url, obj, content_type=JOSE_CONTENT_TYPE, acme_version=1, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/crypto_util.py new/acme-1.1.0/acme/crypto_util.py --- old/acme-1.0.0/acme/crypto_util.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/crypto_util.py 2020-01-14 19:41:31.000000000 +0100 @@ -6,15 +6,15 @@ import re import socket -from OpenSSL import crypto -from OpenSSL import SSL # type: ignore # https://github.com/python/typeshed/issues/2052 import josepy as jose +from OpenSSL import crypto +from OpenSSL import SSL # type: ignore # https://github.com/python/typeshed/issues/2052 from acme import errors -# pylint: disable=unused-import, no-name-in-module -from acme.magic_typing import Callable, Union, Tuple, Optional -# pylint: enable=unused-import, no-name-in-module - +from acme.magic_typing import Callable # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import Optional # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import Tuple # pylint: disable=unused-import, no-name-in-module +from acme.magic_typing import Union # pylint: disable=unused-import, no-name-in-module logger = logging.getLogger(__name__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/errors.py new/acme-1.1.0/acme/errors.py --- old/acme-1.0.0/acme/errors.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/errors.py 2020-01-14 19:41:31.000000000 +0100 @@ -29,7 +29,12 @@ class BadNonce(NonceError): """Bad nonce error.""" def __init__(self, nonce, error, *args, **kwargs): - super(BadNonce, self).__init__(*args, **kwargs) + # MyPy complains here that there is too many arguments for BaseException constructor. + # This is an error fixed in typeshed, see https://github.com/python/mypy/issues/4183 + # The fix is included in MyPy>=0.740, but upgrading it would bring dozen of errors due to + # new types definitions. So we ignore the error until the code base is fixed to match + # with MyPy>=0.740 referential. + super(BadNonce, self).__init__(*args, **kwargs) # type: ignore self.nonce = nonce self.error = error @@ -48,7 +53,8 @@ """ def __init__(self, response, *args, **kwargs): - super(MissingNonce, self).__init__(*args, **kwargs) + # See comment in BadNonce constructor above for an explanation of type: ignore here. + super(MissingNonce, self).__init__(*args, **kwargs) # type: ignore self.response = response def __str__(self): @@ -83,6 +89,7 @@ return '{0}(exhausted={1!r}, updated={2!r})'.format( self.__class__.__name__, self.exhausted, self.updated) + class ValidationError(Error): """Error for authorization failures. Contains a list of authorization resources, each of which is invalid and should have an error field. @@ -91,9 +98,11 @@ self.failed_authzrs = failed_authzrs super(ValidationError, self).__init__() -class TimeoutError(Error): + +class TimeoutError(Error): # pylint: disable=redefined-builtin """Error for when polling an authorization or an order times out.""" + class IssuanceError(Error): """Error sent by the server after requesting issuance of a certificate.""" @@ -105,6 +114,7 @@ self.error = error super(IssuanceError, self).__init__() + class ConflictError(ClientError): """Error for when the server returns a 409 (Conflict) HTTP status. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/fields.py new/acme-1.1.0/acme/fields.py --- old/acme-1.0.0/acme/fields.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/fields.py 2020-01-14 19:41:31.000000000 +0100 @@ -4,7 +4,6 @@ import josepy as jose import pyrfc3339 - logger = logging.getLogger(__name__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/jws.py new/acme-1.1.0/acme/jws.py --- old/acme-1.0.0/acme/jws.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/jws.py 2020-01-14 19:41:31.000000000 +0100 @@ -40,7 +40,7 @@ class JWS(jose.JWS): """ACME-specific JWS. Includes none, url, and kid in protected header.""" signature_cls = Signature - __slots__ = jose.JWS._orig_slots # pylint: disable=no-member + __slots__ = jose.JWS._orig_slots @classmethod # pylint: disable=arguments-differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/magic_typing.py new/acme-1.1.0/acme/magic_typing.py --- old/acme-1.0.0/acme/magic_typing.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/magic_typing.py 2020-01-14 19:41:31.000000000 +0100 @@ -1,6 +1,7 @@ """Shim class to not have to depend on typing module in prod.""" import sys + class TypingClass(object): """Ignore import errors by getting anything""" def __getattr__(self, name): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/messages.py new/acme-1.1.0/acme/messages.py --- old/acme-1.0.0/acme/messages.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/messages.py 2020-01-14 19:41:31.000000000 +0100 @@ -1,18 +1,21 @@ """ACME protocol messages.""" import json -import six -try: - from collections.abc import Hashable # pylint: disable=no-name-in-module -except ImportError: # pragma: no cover - from collections import Hashable import josepy as jose +import six from acme import challenges from acme import errors from acme import fields -from acme import util from acme import jws +from acme import util + +try: + from collections.abc import Hashable # pylint: disable=no-name-in-module +except ImportError: # pragma: no cover + from collections import Hashable + + OLD_ERROR_PREFIX = "urn:acme:error:" ERROR_PREFIX = "urn:ietf:params:acme:error:" @@ -143,7 +146,7 @@ if jobj not in cls.POSSIBLE_NAMES: # pylint: disable=unsupported-membership-test raise jose.DeserializationError( '{0} not recognized'.format(cls.__name__)) - return cls.POSSIBLE_NAMES[jobj] # pylint: disable=unsubscriptable-object + return cls.POSSIBLE_NAMES[jobj] def __repr__(self): return '{0}({1})'.format(self.__class__.__name__, self.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme/standalone.py new/acme-1.1.0/acme/standalone.py --- old/acme-1.0.0/acme/standalone.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/acme/standalone.py 2020-01-14 19:41:31.000000000 +0100 @@ -11,8 +11,7 @@ from acme import challenges from acme import crypto_util -from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module - +from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module logger = logging.getLogger(__name__) @@ -45,7 +44,7 @@ return socketserver.TCPServer.server_bind(self) -class ACMEServerMixin: # pylint: disable=old-style-class +class ACMEServerMixin: """ACME server common settings mixin.""" # TODO: c.f. #858 server_version = "ACME client standalone challenge solver" @@ -106,7 +105,6 @@ """Wraps socketserver.TCPServer.serve_forever""" for server in self.servers: thread = threading.Thread( - # pylint: disable=no-member target=server.serve_forever) thread.start() self.threads.append(thread) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/acme.egg-info/PKG-INFO new/acme-1.1.0/acme.egg-info/PKG-INFO --- old/acme-1.0.0/acme.egg-info/PKG-INFO 2019-12-03 18:20:41.000000000 +0100 +++ new/acme-1.1.0/acme.egg-info/PKG-INFO 2020-01-14 19:41:44.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: acme -Version: 1.0.0 +Version: 1.1.0 Summary: ACME protocol implementation in Python Home-page: https://github.com/letsencrypt/letsencrypt Author: Certbot Project diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/docs/conf.py new/acme-1.1.0/docs/conf.py --- old/acme-1.0.0/docs/conf.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/docs/conf.py 2020-01-14 19:41:31.000000000 +0100 @@ -12,10 +12,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex - +import sys here = os.path.abspath(os.path.dirname(__file__)) @@ -42,7 +41,7 @@ ] autodoc_member_order = 'bysource' -autodoc_default_flags = ['show-inheritance', 'private-members'] +autodoc_default_flags = ['show-inheritance'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/examples/http01_example.py new/acme-1.1.0/examples/http01_example.py --- old/acme-1.0.0/examples/http01_example.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/examples/http01_example.py 2020-01-14 19:41:31.000000000 +0100 @@ -26,8 +26,10 @@ - Deactivate Account """ from contextlib import contextmanager + from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa +import josepy as jose import OpenSSL from acme import challenges @@ -36,7 +38,6 @@ from acme import errors from acme import messages from acme import standalone -import josepy as jose # Constants: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/setup.py new/acme-1.1.0/setup.py --- old/acme-1.0.0/setup.py 2019-12-03 18:20:32.000000000 +0100 +++ new/acme-1.1.0/setup.py 2020-01-14 19:41:33.000000000 +0100 @@ -1,9 +1,10 @@ -from setuptools import setup +import sys + from setuptools import find_packages +from setuptools import setup from setuptools.command.test import test as TestCommand -import sys -version = '1.0.0' +version = '1.1.0' # Please update tox.ini when modifying dependency version requirements install_requires = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/challenges_test.py new/acme-1.1.0/tests/challenges_test.py --- old/acme-1.0.0/tests/challenges_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/challenges_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -4,8 +4,7 @@ import josepy as jose import mock import requests - -from six.moves.urllib import parse as urllib_parse # pylint: disable=relative-import +from six.moves.urllib import parse as urllib_parse import test_util @@ -19,7 +18,6 @@ from acme.challenges import Challenge from acme.challenges import UnrecognizedChallenge chall = UnrecognizedChallenge({"type": "foo"}) - # pylint: disable=no-member self.assertEqual(chall, Challenge.from_json(chall.jobj)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/client_test.py new/acme-1.1.0/tests/client_test.py --- old/acme-1.0.0/tests/client_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/client_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -5,19 +5,17 @@ import json import unittest -from six.moves import http_client # pylint: disable=import-error - import josepy as jose import mock import OpenSSL import requests +from six.moves import http_client # pylint: disable=import-error from acme import challenges 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.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module import messages_test import test_util @@ -63,7 +61,7 @@ self.contact = ('mailto:[email protected]', 'tel:+12025551212') reg = messages.Registration( contact=self.contact, key=KEY.public_key()) - the_arg = dict(reg) # type: Dict + the_arg = dict(reg) # type: Dict self.new_reg = messages.NewRegistration(**the_arg) self.regr = messages.RegistrationResource( body=reg, uri='https://www.letsencrypt-demo.org/acme/reg/1') @@ -887,19 +885,6 @@ new_nonce_url='https://www.letsencrypt-demo.org/acme/new-nonce') self.client.net.get.assert_not_called() - class FakeError(messages.Error): - """Fake error to reproduce a malformed request ACME error""" - def __init__(self): # pylint: disable=super-init-not-called - pass - @property - def code(self): - return 'malformed' - self.client.net.post.side_effect = FakeError() - - self.client.poll(self.authzr2) # pylint: disable=protected-access - - self.client.net.get.assert_called_once_with(self.authzr2.uri) - class MockJSONDeSerializable(jose.JSONDeSerializable): # pylint: disable=missing-docstring @@ -965,8 +950,8 @@ def test_check_response_not_ok_jobj_error(self): self.response.ok = False - self.response.json.return_value = messages.Error( - detail='foo', typ='serverInternal', title='some title').to_json() + self.response.json.return_value = messages.Error.with_code( + 'serverInternal', detail='foo', title='some title').to_json() # pylint: disable=protected-access self.assertRaises( messages.Error, self.net._check_response, self.response) @@ -991,7 +976,7 @@ self.response.json.side_effect = ValueError for response_ct in [self.net.JSON_CONTENT_TYPE, 'foo']: self.response.headers['Content-Type'] = response_ct - # pylint: disable=protected-access,no-value-for-parameter + # pylint: disable=protected-access self.assertEqual( self.response, self.net._check_response(self.response)) @@ -1005,7 +990,7 @@ self.response.json.return_value = {} for response_ct in [self.net.JSON_CONTENT_TYPE, 'foo']: self.response.headers['Content-Type'] = response_ct - # pylint: disable=protected-access,no-value-for-parameter + # pylint: disable=protected-access self.assertEqual( self.response, self.net._check_response(self.response)) @@ -1130,8 +1115,8 @@ self.response.headers = {} self.response.links = {} self.response.checked = False - self.acmev1_nonce_response = mock.MagicMock(ok=False, - status_code=http_client.METHOD_NOT_ALLOWED) + self.acmev1_nonce_response = mock.MagicMock( + ok=False, status_code=http_client.METHOD_NOT_ALLOWED) self.acmev1_nonce_response.headers = {} self.obj = mock.MagicMock() self.wrapped_obj = mock.MagicMock() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/crypto_util_test.py new/acme-1.1.0/tests/crypto_util_test.py --- old/acme-1.0.0/tests/crypto_util_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/crypto_util_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -5,17 +5,16 @@ import time import unittest -import six -from six.moves import socketserver #type: ignore # pylint: disable=import-error - import josepy as jose import OpenSSL +import six +from six.moves import socketserver # type: ignore # pylint: disable=import-error from acme import errors -from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module - +from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module import test_util + class SSLSocketAndProbeSNITest(unittest.TestCase): """Tests for acme.crypto_util.SSLSocket/probe_sni.""" @@ -39,7 +38,6 @@ self.server = _TestServer(('', 0), socketserver.BaseRequestHandler) self.port = self.server.socket.getsockname()[1] self.server_thread = threading.Thread( - # pylint: disable=no-member target=self.server.handle_request) def tearDown(self): @@ -66,7 +64,7 @@ def test_probe_connection_error(self): # pylint has a hard time with six - self.server.server_close() # pylint: disable=no-member + self.server.server_close() original_timeout = socket.getdefaulttimeout() try: socket.setdefaulttimeout(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/jose_test.py new/acme-1.1.0/tests/jose_test.py --- old/acme-1.0.0/tests/jose_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/jose_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -2,6 +2,7 @@ import importlib import unittest + class JoseTest(unittest.TestCase): """Tests for acme.jose shim.""" @@ -20,11 +21,10 @@ # We use the imports below with eval, but pylint doesn't # understand that. - # pylint: disable=eval-used,unused-variable - import acme - import josepy - acme_jose_mod = eval(acme_jose_path) - josepy_mod = eval(josepy_path) + import acme # pylint: disable=unused-import + import josepy # pylint: disable=unused-import + acme_jose_mod = eval(acme_jose_path) # pylint: disable=eval-used + josepy_mod = eval(josepy_path) # pylint: disable=eval-used self.assertIs(acme_jose_mod, josepy_mod) self.assertIs(getattr(acme_jose_mod, attribute), getattr(josepy_mod, attribute)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/jws_test.py new/acme-1.1.0/tests/jws_test.py --- old/acme-1.0.0/tests/jws_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/jws_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -5,7 +5,6 @@ import test_util - KEY = jose.JWKRSA.load(test_util.load_vector('rsa512_key.pem')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/messages_test.py new/acme-1.1.0/tests/messages_test.py --- old/acme-1.0.0/tests/messages_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/messages_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -5,8 +5,7 @@ import mock from acme import challenges -from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module - +from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module import test_util CERT = test_util.load_comparable_cert('cert.der') @@ -19,8 +18,7 @@ def setUp(self): from acme.messages import Error, ERROR_PREFIX - self.error = Error( - detail='foo', typ=ERROR_PREFIX + 'malformed', title='title') + self.error = Error.with_code('malformed', detail='foo', title='title') self.jobj = { 'detail': 'foo', 'title': 'some title', @@ -28,7 +26,6 @@ } self.error_custom = Error(typ='custom', detail='bar') self.empty_error = Error() - self.jobj_custom = {'type': 'custom', 'detail': 'bar'} def test_default_typ(self): from acme.messages import Error @@ -43,8 +40,7 @@ hash(Error.from_json(self.error.to_json())) def test_description(self): - self.assertEqual( - 'The request message was malformed', self.error.description) + self.assertEqual('The request message was malformed', self.error.description) self.assertTrue(self.error_custom.description is None) def test_code(self): @@ -54,17 +50,17 @@ self.assertEqual(None, Error().code) def test_is_acme_error(self): - from acme.messages import is_acme_error + from acme.messages import is_acme_error, Error self.assertTrue(is_acme_error(self.error)) self.assertFalse(is_acme_error(self.error_custom)) + self.assertFalse(is_acme_error(Error())) self.assertFalse(is_acme_error(self.empty_error)) self.assertFalse(is_acme_error("must pet all the {dogs|rabbits}")) def test_unicode_error(self): - from acme.messages import Error, ERROR_PREFIX, is_acme_error - arabic_error = Error( - detail=u'\u0639\u062f\u0627\u0644\u0629', typ=ERROR_PREFIX + 'malformed', - title='title') + from acme.messages import Error, is_acme_error + arabic_error = Error.with_code( + 'malformed', detail=u'\u0639\u062f\u0627\u0644\u0629', title='title') self.assertTrue(is_acme_error(arabic_error)) def test_with_code(self): @@ -305,8 +301,7 @@ from acme.messages import Error from acme.messages import STATUS_INVALID self.status = STATUS_INVALID - error = Error(typ='urn:ietf:params:acme:error:serverInternal', - detail='Unable to communicate with DNS server') + error = Error.with_code('serverInternal', detail='Unable to communicate with DNS server') self.challb = ChallengeBody( uri='http://challb', chall=self.chall, status=self.status, error=error) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/standalone_test.py new/acme-1.1.0/tests/standalone_test.py --- old/acme-1.0.0/tests/standalone_test.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/standalone_test.py 2020-01-14 19:41:31.000000000 +0100 @@ -3,18 +3,17 @@ import threading import unittest -from six.moves import http_client # pylint: disable=import-error -from six.moves import socketserver # type: ignore # pylint: disable=import-error - import josepy as jose import mock import requests +from six.moves import http_client # pylint: disable=import-error +from six.moves import socketserver # type: ignore # pylint: disable=import-error from acme import challenges -from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module - +from acme.magic_typing import Set # pylint: disable=unused-import, no-name-in-module import test_util + class TLSServerTest(unittest.TestCase): """Tests for acme.standalone.TLSServer.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acme-1.0.0/tests/test_util.py new/acme-1.1.0/tests/test_util.py --- old/acme-1.0.0/tests/test_util.py 2019-12-03 18:20:30.000000000 +0100 +++ new/acme-1.1.0/tests/test_util.py 2020-01-14 19:41:31.000000000 +0100 @@ -4,12 +4,12 @@ """ import os -import pkg_resources from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import josepy as jose from OpenSSL import crypto +import pkg_resources def load_vector(*names): @@ -25,8 +25,7 @@ return loader_pem elif ext.lower() == '.der': return loader_der - else: # pragma: no cover - raise ValueError("Loader could not be recognized based on extension") + raise ValueError("Loader could not be recognized based on extension") # pragma: no cover def load_cert(*names):
