bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)

Modify asyncio tests to utilize the certificates from the test directory
instead of its own set, as they are the same and with each update they had
to be updated as well.
This commit is contained in:
stratakis 2018-11-30 17:56:56 +01:00 committed by Victor Stinner
parent 9eea6eaf23
commit b062ba77b6
6 changed files with 4 additions and 185 deletions

View file

@ -40,7 +40,7 @@ def data_file(filename):
fullname = os.path.join(support.TEST_HOME_DIR, filename)
if os.path.isfile(fullname):
return fullname
fullname = os.path.join(os.path.dirname(__file__), filename)
fullname = os.path.join(os.path.dirname(__file__), '..', filename)
if os.path.isfile(fullname):
return fullname
raise FileNotFoundError(filename)
@ -160,8 +160,8 @@ class SSLWSGIServerMixin:
if not os.path.isdir(here):
here = os.path.join(os.path.dirname(os.__file__),
'test', 'test_asyncio')
keyfile = os.path.join(here, 'ssl_key.pem')
certfile = os.path.join(here, 'ssl_cert.pem')
keyfile = os.path.join(here, ONLYKEY)
certfile = os.path.join(here, ONLYCERT)
context = ssl.SSLContext()
context.load_cert_chain(certfile, keyfile)