mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
Make acme tests internal (#9625)
This is a first step towards implementing the plan I described at https://github.com/certbot/certbot/issues/7909#issuecomment-1448675456 which got a +1 from both Erica and Will. Similar changes for our other packages will be made in followup PRs to try and make this easier to review. It may be helpful to look at https://github.com/certbot/certbot/pull/7600 when reviewing this PR where we did something similar in the past. The value of `ignore-paths` in `.pylintrc` should work on Windows based on https://pylint.readthedocs.io/en/latest/user_guide/configuration/all-options.html#ignore-paths and the fact that on macOS/linux, changing path delimiters to `\` still causes these directories to be ignored. I started testing this for mypy as well, but mypy doesn't current pass for us on Windows so I didn't bother and took this opportunity to remove it from the default environments in `tox.ini`. I'll update https://github.com/certbot/certbot/issues/7803 to mention that the value of `exclude` in `mypy.ini` may need to be tweaked if anyone works on that issue. * make acme tests internal * no mypy-win
This commit is contained in:
@@ -48,7 +48,10 @@ ignore=CVS
|
||||
# ignore-list. The regex matches against paths and can be in Posix or Windows
|
||||
# format. Because '\' represents the directory delimiter on Windows systems, it
|
||||
# can't be used as an escape character.
|
||||
ignore-paths=
|
||||
# CERTBOT COMMENT
|
||||
# Changing this line back to the default of `ignore-paths=` is being tracked by
|
||||
# https://github.com/certbot/certbot/issues/7908.
|
||||
ignore-paths=.*/_internal/tests/
|
||||
|
||||
# Files or directories matching the regular expression patterns are skipped.
|
||||
# The regex matches against base names, not paths. The default value ignores
|
||||
|
||||
@@ -3,7 +3,7 @@ include README.rst
|
||||
include pytest.ini
|
||||
recursive-include docs *
|
||||
recursive-include examples *
|
||||
recursive-include tests *
|
||||
recursive-include acme/_internal/tests/testdata *
|
||||
include acme/py.typed
|
||||
global-exclude __pycache__
|
||||
global-exclude *.py[cod]
|
||||
|
||||
1
acme/acme/_internal/__init__.py
Normal file
1
acme/acme/_internal/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""acme's internal implementation"""
|
||||
1
acme/acme/_internal/tests/__init__.py
Normal file
1
acme/acme/_internal/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""acme tests"""
|
||||
@@ -11,7 +11,7 @@ import pytest
|
||||
import requests
|
||||
|
||||
from acme import errors
|
||||
import test_util
|
||||
from acme._internal.tests import test_util
|
||||
|
||||
CERT = test_util.load_comparable_cert('cert.pem')
|
||||
KEY = jose.JWKRSA(key=test_util.load_rsa_private_key('rsa512_key.pem'))
|
||||
@@ -17,10 +17,10 @@ from acme import challenges
|
||||
from acme import errors
|
||||
from acme import jws as acme_jws
|
||||
from acme import messages
|
||||
from acme._internal.tests import messages_test
|
||||
from acme._internal.tests import test_util
|
||||
from acme.client import ClientNetwork
|
||||
from acme.client import ClientV2
|
||||
import messages_test
|
||||
import test_util
|
||||
|
||||
CERT_SAN_PEM = test_util.load_vector('cert-san.pem')
|
||||
CSR_MIXED_PEM = test_util.load_vector('csr-mixed.pem')
|
||||
@@ -14,7 +14,7 @@ import OpenSSL
|
||||
import pytest
|
||||
|
||||
from acme import errors
|
||||
import test_util
|
||||
from acme._internal.tests import test_util
|
||||
|
||||
|
||||
class SSLSocketAndProbeSNITest(unittest.TestCase):
|
||||
@@ -5,7 +5,7 @@ import unittest
|
||||
import josepy as jose
|
||||
import pytest
|
||||
|
||||
import test_util
|
||||
from acme._internal.tests import test_util
|
||||
|
||||
KEY = jose.JWKRSA.load(test_util.load_vector('rsa512_key.pem'))
|
||||
|
||||
@@ -10,7 +10,7 @@ import josepy as jose
|
||||
import pytest
|
||||
|
||||
from acme import challenges
|
||||
import test_util
|
||||
from acme._internal.tests import test_util
|
||||
|
||||
CERT = test_util.load_comparable_cert('cert.der')
|
||||
CSR = test_util.load_comparable_csr('csr.der')
|
||||
@@ -15,7 +15,7 @@ import requests
|
||||
from acme import challenges
|
||||
from acme import crypto_util
|
||||
from acme import errors
|
||||
import test_util
|
||||
from acme._internal.tests import test_util
|
||||
|
||||
|
||||
class TLSServerTest(unittest.TestCase):
|
||||
3
mypy.ini
3
mypy.ini
@@ -1,4 +1,7 @@
|
||||
[mypy]
|
||||
# Removing this exclude setting is being tracked by
|
||||
# https://github.com/certbot/certbot/issues/7909.
|
||||
exclude = .*/_internal/tests/
|
||||
ignore_missing_imports = True
|
||||
warn_unused_ignores = True
|
||||
show_error_codes = True
|
||||
|
||||
4
tox.ini
4
tox.ini
@@ -4,7 +4,9 @@
|
||||
|
||||
[tox]
|
||||
skipsdist = true
|
||||
envlist = {cover,lint,mypy}-{win,posix}
|
||||
# mypy doesn't current pass for us on Windows. Fixing that is being tracked by
|
||||
# https://github.com/certbot/certbot/issues/7803.
|
||||
envlist = {cover,lint}-{win,posix},mypy-posix
|
||||
|
||||
[base]
|
||||
# pip installs the requested packages in editable mode
|
||||
|
||||
Reference in New Issue
Block a user