2020-05-02 22:50:52 +01:00
|
|
|
import textwrap
|
|
|
|
|
|
2021-01-06 13:50:58 -05:00
|
|
|
from . import test_projects, utils
|
2020-05-02 16:54:19 +01:00
|
|
|
|
2020-05-17 16:54:33 +01:00
|
|
|
project_with_ssl_tests = test_projects.new_c_project(
|
2021-04-30 17:56:34 -04:00
|
|
|
setup_py_add=textwrap.dedent(
|
2021-05-03 11:45:43 -04:00
|
|
|
r"""
|
2020-05-02 16:54:19 +01:00
|
|
|
import ssl
|
|
|
|
|
|
2021-02-14 20:44:20 +01:00
|
|
|
from urllib.request import urlopen
|
2020-05-02 16:54:19 +01:00
|
|
|
|
2020-10-10 18:24:15 +02:00
|
|
|
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
|
|
|
|
data = urlopen("https://www.nist.gov", context=context)
|
2021-05-27 10:28:52 +01:00
|
|
|
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/CI.md", context=context)
|
|
|
|
|
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/CI.md")
|
2021-05-03 11:45:43 -04:00
|
|
|
"""
|
2021-04-30 17:56:34 -04:00
|
|
|
)
|
2020-05-02 16:54:19 +01:00
|
|
|
)
|
|
|
|
|
|
2020-05-02 22:50:52 +01:00
|
|
|
|
2020-05-03 14:08:57 +01:00
|
|
|
def test(tmp_path):
|
2020-05-02 16:54:19 +01:00
|
|
|
# this test checks that SSL is working in the build environment using
|
|
|
|
|
# some checks in setup.py.
|
2021-05-03 11:45:43 -04:00
|
|
|
project_dir = tmp_path / "project"
|
2020-05-02 16:54:19 +01:00
|
|
|
project_with_ssl_tests.generate(project_dir)
|
|
|
|
|
|
2020-05-15 12:19:38 +01:00
|
|
|
actual_wheels = utils.cibuildwheel_run(project_dir)
|
|
|
|
|
|
2021-05-03 11:45:43 -04:00
|
|
|
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
2020-05-15 12:19:38 +01:00
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|