mirror of
https://github.com/python/cpython.git
synced 2025-11-28 14:11:15 +00:00
sysconfig.get_scheme_names now returns a sorted tuple
This commit is contained in:
parent
cc11817808
commit
e81b0289b6
2 changed files with 10 additions and 2 deletions
|
|
@ -343,7 +343,9 @@ def get_config_h_filename():
|
||||||
|
|
||||||
def get_scheme_names():
|
def get_scheme_names():
|
||||||
"""Returns a tuple containing the schemes names."""
|
"""Returns a tuple containing the schemes names."""
|
||||||
return _INSTALL_SCHEMES.keys()
|
schemes = _INSTALL_SCHEMES.keys()
|
||||||
|
schemes.sort()
|
||||||
|
return tuple(schemes)
|
||||||
|
|
||||||
def get_path_names():
|
def get_path_names():
|
||||||
"""Returns a tuple containing the paths names."""
|
"""Returns a tuple containing the paths names."""
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ from test.test_support import run_unittest, TESTFN
|
||||||
import sysconfig
|
import sysconfig
|
||||||
from sysconfig import (get_paths, get_platform, get_config_vars,
|
from sysconfig import (get_paths, get_platform, get_config_vars,
|
||||||
get_path, get_path_names, _INSTALL_SCHEMES,
|
get_path, get_path_names, _INSTALL_SCHEMES,
|
||||||
_get_default_scheme, _expand_vars)
|
_get_default_scheme, _expand_vars,
|
||||||
|
get_scheme_names)
|
||||||
|
|
||||||
class TestSysConfig(unittest.TestCase):
|
class TestSysConfig(unittest.TestCase):
|
||||||
|
|
||||||
|
|
@ -232,6 +233,11 @@ class TestSysConfig(unittest.TestCase):
|
||||||
config_h = sysconfig.get_config_h_filename()
|
config_h = sysconfig.get_config_h_filename()
|
||||||
self.assertTrue(os.path.isfile(config_h), config_h)
|
self.assertTrue(os.path.isfile(config_h), config_h)
|
||||||
|
|
||||||
|
def test_get_scheme_names(self):
|
||||||
|
wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'posix_home',
|
||||||
|
'posix_prefix', 'posix_user')
|
||||||
|
self.assertEquals(get_scheme_names(), wanted)
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
run_unittest(TestSysConfig)
|
run_unittest(TestSysConfig)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue