@@ -599,6 +599,13 @@ def test_platform_tags(platform_name, dispatch_func, monkeypatch):
599
599
assert tags .platform_tags () == expected
600
600
601
601
602
+ def test_platform_tags_space (monkeypatch ):
603
+ """Ensure spaces in platform tags are normalized to underscores."""
604
+ monkeypatch .setattr (platform , "system" , lambda : "Isilon OneFS" )
605
+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : "isilon onefs" )
606
+ assert list (tags .platform_tags ()) == ["isilon_onefs" ]
607
+
608
+
602
609
class TestCPythonABI :
603
610
@pytest .mark .parametrize (
604
611
"py_debug,gettotalrefcount,result" ,
@@ -770,6 +777,12 @@ def test_platforms_defaults_needs_underscore(self, monkeypatch):
770
777
result = list (tags .cpython_tags ((3 , 11 ), abis = ["whatever" ]))
771
778
assert tags .Tag ("cp311" , "whatever" , "plat1" ) in result
772
779
780
+ def test_platform_name_space_normalization (self , monkeypatch ):
781
+ """Ensure that spaces are translated to underscores in platform names."""
782
+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : "isilon onefs" )
783
+ for tag in tags .cpython_tags ():
784
+ assert " " not in tag .platform
785
+
773
786
def test_major_only_python_version (self ):
774
787
result = list (tags .cpython_tags ((3 ,), ["abi" ], ["plat" ]))
775
788
assert result == [
@@ -839,9 +852,9 @@ def test__generic_abi_linux_cpython(self, monkeypatch):
839
852
assert tags ._generic_abi () == ["cp37m" ]
840
853
841
854
def test__generic_abi_jp (self , monkeypatch ):
842
- config = {"EXT_SUFFIX" : ".return exactly this .so" }
855
+ config = {"EXT_SUFFIX" : ".return_exactly_this .so" }
843
856
monkeypatch .setattr (sysconfig , "get_config_var" , config .__getitem__ )
844
- assert tags ._generic_abi () == ["return exactly this " ]
857
+ assert tags ._generic_abi () == ["return_exactly_this " ]
845
858
846
859
def test__generic_abi_graal (self , monkeypatch ):
847
860
config = {"EXT_SUFFIX" : ".graalpy-38-native-x86_64-darwin.so" }
@@ -897,6 +910,12 @@ def test_generic_platforms(self):
897
910
platform = platform .replace ("." , "_" )
898
911
assert list (tags ._generic_platforms ()) == [platform ]
899
912
913
+ def test_generic_platforms_space (self , monkeypatch ):
914
+ """Ensure platform tags normalize spaces to underscores."""
915
+ platform_ = "isilon onefs"
916
+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : platform_ )
917
+ assert list (tags ._generic_platforms ()) == [platform_ .replace (" " , "_" )]
918
+
900
919
def test_iterator_returned (self ):
901
920
result_iterator = tags .generic_tags ("sillywalk33" , ["abi" ], ["plat1" , "plat2" ])
902
921
assert isinstance (result_iterator , collections .abc .Iterator )
0 commit comments