Skip to content

Commit 659d81d

Browse files
committed
verify that hyphens are never allowed in tags
1 parent 26d078c commit 659d81d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/unit/test_wheel.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,27 @@ def raises_ioerror(var):
307307
with patch('pip.pep425tags.sysconfig.get_config_var', raises_ioerror):
308308
assert len(pip.pep425tags.get_supported())
309309

310+
def test_no_hyphen_tag(self):
311+
"""
312+
Test that no tag contains a hyphen.
313+
"""
314+
import pip.pep425tags
315+
316+
get_config_var = pip.pep425tags.sysconfig.get_config_var
317+
318+
def mock_soabi(var):
319+
if var == 'SOABI':
320+
return 'cpython-35m-darwin'
321+
return get_config_var(var)
322+
323+
with patch('pip.pep425tags.sysconfig.get_config_var', mock_soabi):
324+
supported = pip.pep425tags.get_supported()
325+
326+
for (py, abi, plat) in supported:
327+
assert '-' not in py
328+
assert '-' not in abi
329+
assert '-' not in plat
330+
310331

311332
class TestMoveWheelFiles(object):
312333
"""

0 commit comments

Comments
 (0)