2020-06-18 02:00:30 +02:00
|
|
|
from pathlib import Path
|
2020-02-02 17:39:18 +00:00
|
|
|
|
2021-01-06 13:50:58 -05:00
|
|
|
from cibuildwheel.util import DependencyConstraints
|
|
|
|
|
|
2020-02-15 11:57:31 +00:00
|
|
|
|
2020-02-02 17:39:18 +00:00
|
|
|
def test_defaults():
|
|
|
|
|
dependency_constraints = DependencyConstraints.with_defaults()
|
|
|
|
|
|
2020-06-18 02:00:30 +02:00
|
|
|
project_root = Path(__file__).parents[1]
|
|
|
|
|
resources_dir = project_root / 'cibuildwheel' / 'resources'
|
2020-02-02 17:39:18 +00:00
|
|
|
|
2020-06-18 02:00:30 +02:00
|
|
|
assert dependency_constraints.base_file_path.samefile(resources_dir / 'constraints.txt')
|
2020-12-21 19:51:27 +01:00
|
|
|
assert dependency_constraints.get_for_python_version('3.99').samefile(resources_dir / 'constraints.txt')
|
|
|
|
|
assert dependency_constraints.get_for_python_version('3.9').samefile(resources_dir / 'constraints-python39.txt')
|
2020-06-18 02:00:30 +02:00
|
|
|
assert dependency_constraints.get_for_python_version('3.6').samefile(resources_dir / 'constraints-python36.txt')
|
|
|
|
|
assert dependency_constraints.get_for_python_version('3.5').samefile(resources_dir / 'constraints-python35.txt')
|
|
|
|
|
assert dependency_constraints.get_for_python_version('2.7').samefile(resources_dir / 'constraints-python27.txt')
|