Files
cibuildwheel/test/test_ssl.py
T
Henry SchreinerandJoe Rickerby 3be2d0c356 chore: rename joerick/cibuildwheel -> pypa/cibuildwheel (#682)
* chore: rename joerick/cibuildwheel -> pypa/cibuildwheel

* Update Appveyor status badge markup

Note that it still has joerick/cibuildwheel - confusingly it's still within my appveyor account, but this is the new project that points to the pypa github repo

* Update Appveyor badge markup again

I went through a few passes to enable that project, here's the latest.

* Update Azure badge, also

* Update Travis badge to reference the .com

Co-authored-by: Joe Rickerby <joerick@mac.com>
2021-05-24 10:21:03 -04:00

31 lines
944 B
Python

import textwrap
from . import test_projects, utils
project_with_ssl_tests = test_projects.new_c_project(
setup_py_add=textwrap.dedent(
r"""
import ssl
from urllib.request import urlopen
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
data = urlopen("https://www.nist.gov", context=context)
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/master/CI.md", context=context)
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/master/CI.md")
"""
)
)
def test(tmp_path):
# this test checks that SSL is working in the build environment using
# some checks in setup.py.
project_dir = tmp_path / "project"
project_with_ssl_tests.generate(project_dir)
actual_wheels = utils.cibuildwheel_run(project_dir)
expected_wheels = utils.expected_wheels("spam", "0.1.0")
assert set(actual_wheels) == set(expected_wheels)