Files
cibuildwheel/test/test_ssl.py
T
cibuildwheel-bot[bot]cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>Henry Schreinerpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
d193a8eff5 tests: fix ci (#2391)
* Update dependencies

* tests: disable color for Pyodide test

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: nist.gov doesn't work anymore for this test

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: limit click for typer

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: cibuildwheel-bot[bot] <83877280+cibuildwheel-bot[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-14 10:06:34 -04:00

31 lines
947 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://tls-v1-2.badssl.com", context=context)
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/CI.md", context=context)
data = urlopen("https://raw.githubusercontent.com/pypa/cibuildwheel/main/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)