@@ -603,6 +603,13 @@ def test_platform_tags(platform_name, dispatch_func, monkeypatch):
603603 assert tags .platform_tags () == expected
604604
605605
606+ def test_platform_tags_space (monkeypatch ):
607+ """Ensure spaces in platform tags are normalized to underscores."""
608+ monkeypatch .setattr (platform , "system" , lambda : "Isilon OneFS" )
609+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : "isilon onefs" )
610+ assert list (tags .platform_tags ()) == ["isilon_onefs" ]
611+
612+
606613class TestCPythonABI :
607614 @pytest .mark .parametrize (
608615 "py_debug,gettotalrefcount,result" ,
@@ -774,6 +781,12 @@ def test_platforms_defaults_needs_underscore(self, monkeypatch):
774781 result = list (tags .cpython_tags ((3 , 11 ), abis = ["whatever" ]))
775782 assert tags .Tag ("cp311" , "whatever" , "plat1" ) in result
776783
784+ def test_platform_name_space_normalization (self , monkeypatch ):
785+ """Ensure that spaces are translated to underscores in platform names."""
786+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : "isilon onefs" )
787+ for tag in tags .cpython_tags ():
788+ assert " " not in tag .platform
789+
777790 def test_major_only_python_version (self ):
778791 result = list (tags .cpython_tags ((3 ,), ["abi" ], ["plat" ]))
779792 assert result == [
@@ -845,6 +858,12 @@ def test_generic_platforms(self):
845858 platform = platform .replace ("." , "_" )
846859 assert list (tags ._generic_platforms ()) == [platform ]
847860
861+ def test_generic_platforms_space (self , monkeypatch ):
862+ """Ensure platform tags normalize spaces to underscores."""
863+ platform_ = "isilon onefs"
864+ monkeypatch .setattr (sysconfig , "get_platform" , lambda : platform_ )
865+ assert list (tags ._generic_platforms ()) == [platform_ .replace (" " , "_" )]
866+
848867 def test_iterator_returned (self ):
849868 result_iterator = tags .generic_tags ("sillywalk33" , ["abi" ], ["plat1" , "plat2" ])
850869 assert isinstance (result_iterator , collections .abc .Iterator )
0 commit comments