diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2020-12-13 13:36:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 13:36:50 +0200 |
commit | ac5c0d9e78002f4aae9fd44e88dab3f5c2aebb2c (patch) | |
tree | 66fddb182684901a134e25a98613ad950f29e3e7 /tests/test_macosx_libfile.py | |
parent | 2736fdae95461d2b23e4bbf0d81b907b71604957 (diff) | |
parent | 16777fb4c075df682c085d48b9c3703a36bf65c3 (diff) | |
download | wheel-git-fix-367.tar.gz |
Merge branch 'master' into fix-367fix-367
Diffstat (limited to 'tests/test_macosx_libfile.py')
-rw-r--r-- | tests/test_macosx_libfile.py | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 0424cb8..f108bde 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -20,7 +20,9 @@ def test_read_from_dylib(): ("test_lib_10_10_386.dylib", "10.10.0"), ("test_lib_10_14_386.dylib", "10.14.0"), ("test_lib_multiple_fat.dylib", "10.14.0"), - ("test_lib_10_10_10.dylib", "10.10.10") + ("test_lib_10_10_10.dylib", "10.10.10"), + ("test_lib_11.dylib", "11.0.0"), + ("test_lib_10_9_universal2.dylib", "10.9.0"), ] for file_name, ver in versions: extracted = extract_macosx_min_system_version( @@ -47,14 +49,14 @@ class TestGetPlatformMacosx: def test_simple(self, monkeypatch): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") - monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.14-x86_64")) - assert get_platform(dylib_dir) == "macosx_10_14_x86_64" + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-11.0-x86_64")) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" def test_version_bump(self, monkeypatch, capsys): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) - assert get_platform(dylib_dir) == "macosx_10_14_x86_64" + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" captured = capsys.readouterr() assert "[WARNING] This wheel needs a higher macOS version than" in captured.err @@ -125,3 +127,28 @@ class TestGetPlatformMacosx: assert get_platform(dylib_dir) == "macosx_10_9_x86_64" captured = capsys.readouterr() assert "MACOSX_DEPLOYMENT_TARGET is set to a lower value (10.8) than the" in captured.err + + def test_get_platform_bigsur_env(self, monkeypatch): + dirname = os.path.dirname(__file__) + dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) + monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", "11") + monkeypatch.setattr(os, "walk", return_factory( + [(dylib_dir, [], ["test_lib_10_6.dylib", "test_lib_10_10_fat.dylib"])] + )) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" + + def test_get_platform_bigsur_platform(self, monkeypatch): + dirname = os.path.dirname(__file__) + dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-11-x86_64")) + monkeypatch.setattr(os, "walk", return_factory( + [(dylib_dir, [], ["test_lib_10_6.dylib", "test_lib_10_10_fat.dylib"])] + )) + assert get_platform(dylib_dir) == "macosx_11_0_x86_64" + + +def test_get_platform_linux(monkeypatch): + monkeypatch.setattr(distutils.util, "get_platform", return_factory("linux_x86_64")) + monkeypatch.setattr(sys, "maxsize", 2147483647) + assert get_platform(None) == "linux_i686" |