Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
import sys
|
2008-05-29 18:22:40 -03:00
|
|
|
import os
|
2005-11-21 13:48:12 -04:00
|
|
|
import unittest
|
|
|
|
import platform
|
2008-10-06 01:51:11 -03:00
|
|
|
import subprocess
|
2005-11-21 13:48:12 -04:00
|
|
|
|
2008-05-20 18:35:26 -03:00
|
|
|
from test import support
|
Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
|
2005-11-21 13:48:12 -04:00
|
|
|
class PlatformTest(unittest.TestCase):
|
|
|
|
def test_architecture(self):
|
|
|
|
res = platform.architecture()
|
|
|
|
|
2008-10-06 01:51:11 -03:00
|
|
|
if hasattr(os, "symlink"):
|
|
|
|
def test_architecture_via_symlink(self): # issue3762
|
|
|
|
def get(python):
|
|
|
|
cmd = [python, '-c',
|
|
|
|
'import platform; print(platform.architecture())']
|
|
|
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
|
|
|
return p.communicate()
|
|
|
|
real = os.path.realpath(sys.executable)
|
|
|
|
link = os.path.abspath(support.TESTFN)
|
|
|
|
os.symlink(real, link)
|
|
|
|
try:
|
|
|
|
self.assertEqual(get(real), get(link))
|
|
|
|
finally:
|
|
|
|
os.remove(link)
|
|
|
|
|
2005-11-21 13:48:12 -04:00
|
|
|
def test_machine(self):
|
|
|
|
res = platform.machine()
|
|
|
|
|
|
|
|
def test_node(self):
|
|
|
|
res = platform.node()
|
|
|
|
|
|
|
|
def test_platform(self):
|
|
|
|
for aliased in (False, True):
|
|
|
|
for terse in (False, True):
|
|
|
|
res = platform.platform(aliased, terse)
|
|
|
|
|
|
|
|
def test_processor(self):
|
|
|
|
res = platform.processor()
|
|
|
|
|
|
|
|
def test_python_build(self):
|
|
|
|
res = platform.python_build()
|
|
|
|
|
|
|
|
def test_python_compiler(self):
|
|
|
|
res = platform.python_compiler()
|
|
|
|
|
|
|
|
def test_version(self):
|
|
|
|
res1 = platform.version()
|
|
|
|
res2 = platform.version_tuple()
|
|
|
|
self.assertEqual(res1, ".".join(res2))
|
|
|
|
|
|
|
|
def test_release(self):
|
|
|
|
res = platform.release()
|
|
|
|
|
|
|
|
def test_system(self):
|
|
|
|
res = platform.system()
|
|
|
|
|
|
|
|
def test_version(self):
|
|
|
|
res = platform.version()
|
|
|
|
|
|
|
|
def test_system_alias(self):
|
|
|
|
res = platform.system_alias(
|
|
|
|
platform.system(),
|
|
|
|
platform.release(),
|
|
|
|
platform.version(),
|
|
|
|
)
|
|
|
|
|
|
|
|
def test_uname(self):
|
|
|
|
res = platform.uname()
|
Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
self.assert_(any(res))
|
2005-11-21 13:48:12 -04:00
|
|
|
|
|
|
|
def test_java_ver(self):
|
|
|
|
res = platform.java_ver()
|
Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
if sys.platform == 'java':
|
|
|
|
self.assert_(all(res))
|
2005-11-21 13:48:12 -04:00
|
|
|
|
|
|
|
def test_win32_ver(self):
|
|
|
|
res = platform.win32_ver()
|
|
|
|
|
|
|
|
def test_mac_ver(self):
|
|
|
|
res = platform.mac_ver()
|
2008-05-29 18:22:40 -03:00
|
|
|
|
2008-06-10 18:44:58 -03:00
|
|
|
if platform.uname()[0] == 'Darwin':
|
2008-05-29 18:22:40 -03:00
|
|
|
# We're on a MacOSX system, check that
|
|
|
|
# the right version information is returned
|
|
|
|
fd = os.popen('sw_vers', 'r')
|
|
|
|
real_ver = None
|
|
|
|
for ln in fd:
|
|
|
|
if ln.startswith('ProductVersion:'):
|
|
|
|
real_ver = ln.strip().split()[-1]
|
|
|
|
break
|
|
|
|
fd.close()
|
|
|
|
self.failIf(real_ver is None)
|
|
|
|
self.assertEquals(res[0], real_ver)
|
|
|
|
|
|
|
|
# res[1] claims to contain
|
|
|
|
# (version, dev_stage, non_release_version)
|
|
|
|
# That information is no longer available
|
|
|
|
self.assertEquals(res[1], ('', '', ''))
|
|
|
|
|
|
|
|
if sys.byteorder == 'little':
|
|
|
|
self.assertEquals(res[2], 'i386')
|
|
|
|
else:
|
|
|
|
self.assertEquals(res[2], 'PowerPC')
|
2005-11-21 13:48:12 -04:00
|
|
|
|
|
|
|
def test_dist(self):
|
|
|
|
res = platform.dist()
|
|
|
|
|
|
|
|
def test_libc_ver(self):
|
2006-04-21 07:40:58 -03:00
|
|
|
import os
|
Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
if os.path.isdir(sys.executable) and \
|
|
|
|
os.path.exists(sys.executable+'.exe'):
|
2006-04-21 07:40:58 -03:00
|
|
|
# Cygwin horror
|
|
|
|
executable = executable + '.exe'
|
Merged revisions 63208-63209,63211-63212,63214-63217,63219-63224,63226-63227,63229-63232,63234-63235,63237-63239,63241,63243-63246,63250-63254,63256-63259,63261,63263-63264,63266-63267,63269-63270,63272-63273,63275-63276,63278,63280-63281,63283-63284,63286-63287,63289-63290,63292-63293,63295-63296,63298-63299,63301-63302,63304-63305,63307,63309-63314,63316-63322,63324-63325,63327-63335,63337-63338,63340-63342,63344-63346,63348 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63208 | georg.brandl | 2008-05-13 15:04:54 -0400 (Tue, 13 May 2008) | 2 lines
#2831: add start argument to enumerate(). Patch by Scott Dial and me.
........
r63209 | marc-andre.lemburg | 2008-05-13 15:10:45 -0400 (Tue, 13 May 2008) | 3 lines
Remove leftovers from reverted setuptools checkin (they were added in r45525).
........
r63211 | georg.brandl | 2008-05-13 17:32:03 -0400 (Tue, 13 May 2008) | 2 lines
Fix a refleak in the _warnings module.
........
r63212 | andrew.kuchling | 2008-05-13 20:46:41 -0400 (Tue, 13 May 2008) | 1 line
List all the removes and renamed modules
........
r63214 | brett.cannon | 2008-05-13 21:09:40 -0400 (Tue, 13 May 2008) | 2 lines
Rewrap some lines in test_py3kwarn.
........
r63219 | georg.brandl | 2008-05-14 02:34:15 -0400 (Wed, 14 May 2008) | 2 lines
Add NEWS entry for #2831.
........
r63220 | neal.norwitz | 2008-05-14 02:47:56 -0400 (Wed, 14 May 2008) | 3 lines
Fix "refleak" by restoring the tearDown method removed by accident (AFAICT)
in r62788.
........
r63221 | georg.brandl | 2008-05-14 03:18:22 -0400 (Wed, 14 May 2008) | 2 lines
Fix another "refleak" by clearing the filters after test.
........
r63222 | neal.norwitz | 2008-05-14 03:21:42 -0400 (Wed, 14 May 2008) | 5 lines
Install the json package and tests as well as the lib2to3 tests
so the tests work when run from an install directory.
They are currently skipped on the daily runs (not from the buildbots)
for checking refleaks, etc.
........
r63256 | andrew.kuchling | 2008-05-14 21:10:24 -0400 (Wed, 14 May 2008) | 1 line
Note some removals and a rename
........
r63311 | brett.cannon | 2008-05-15 00:36:53 -0400 (Thu, 15 May 2008) | 2 lines
Add a snippet for the deprecation directive for docs.
........
r63313 | gregory.p.smith | 2008-05-15 00:56:18 -0400 (Thu, 15 May 2008) | 5 lines
disable the crashing test. I will also file a bug. This crash does
not appear to be a new bug, its just that the test coverage went up
recently exposing it. (I verified that by testing this test code on
an older Modules/_bsddb.c)
........
r63320 | georg.brandl | 2008-05-15 11:08:32 -0400 (Thu, 15 May 2008) | 2 lines
#2863: add gen.__name__ and add this name to generator repr().
........
r63324 | andrew.kuchling | 2008-05-15 16:07:39 -0400 (Thu, 15 May 2008) | 1 line
Import class from distutils.cmd, not .core, to avoid circular import
........
r63327 | alexandre.vassalotti | 2008-05-15 16:31:42 -0400 (Thu, 15 May 2008) | 2 lines
Fixed typo in a doctest of test_genexps.
........
r63332 | benjamin.peterson | 2008-05-15 18:34:33 -0400 (Thu, 15 May 2008) | 2 lines
add Mac modules to the list of deprecated ones
........
r63333 | benjamin.peterson | 2008-05-15 18:41:16 -0400 (Thu, 15 May 2008) | 2 lines
fix typos in whatsnew
........
r63348 | benjamin.peterson | 2008-05-15 22:24:49 -0400 (Thu, 15 May 2008) | 2 lines
make test_platform a bit more assertive (We'll see what the buildbots say.)
........
2008-05-16 01:39:54 -03:00
|
|
|
res = platform.libc_ver(sys.executable)
|
2005-11-21 13:48:12 -04:00
|
|
|
|
Merged revisions 66974,66977,66984,66989,66992,66994-66996,66998-67000,67007,67015 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66974 | benjamin.peterson | 2008-10-19 08:59:01 -0500 (Sun, 19 Oct 2008) | 1 line
fix compiler warning
........
r66977 | benjamin.peterson | 2008-10-19 14:39:16 -0500 (Sun, 19 Oct 2008) | 1 line
mention -n
........
r66984 | armin.ronacher | 2008-10-20 16:29:08 -0500 (Mon, 20 Oct 2008) | 3 lines
Fixed #4062, added import for _ast.__version__ to ast to match the documented behavior.
........
r66989 | matthias.klose | 2008-10-21 04:12:25 -0500 (Tue, 21 Oct 2008) | 2 lines
- install versioned manpage
........
r66992 | benjamin.peterson | 2008-10-21 15:51:13 -0500 (Tue, 21 Oct 2008) | 1 line
make sure to call iteritems()
........
r66994 | amaury.forgeotdarc | 2008-10-21 17:01:38 -0500 (Tue, 21 Oct 2008) | 6 lines
#4157 move two test functions out of platform.py.
Turn them into unit tests, and correct an obvious typo:
(("a", "b") ("c", "d") ("e", "f"))
compiles even with the missing commas, but does not execute very well...
........
r66995 | benjamin.peterson | 2008-10-21 17:18:29 -0500 (Tue, 21 Oct 2008) | 1 line
return ArgInfo from inspect.getargvalues #4092
........
r66996 | benjamin.peterson | 2008-10-21 17:20:31 -0500 (Tue, 21 Oct 2008) | 1 line
add NEWs note for last change
........
r66998 | benjamin.peterson | 2008-10-22 15:57:43 -0500 (Wed, 22 Oct 2008) | 1 line
fix a few typos
........
r66999 | benjamin.peterson | 2008-10-22 16:05:30 -0500 (Wed, 22 Oct 2008) | 1 line
and another typo...
........
r67000 | benjamin.peterson | 2008-10-22 16:16:34 -0500 (Wed, 22 Oct 2008) | 1 line
fix #4150: pdb's up command didn't work for generators in post-mortem
........
r67007 | benjamin.peterson | 2008-10-23 16:43:48 -0500 (Thu, 23 Oct 2008) | 1 line
only nonempty __slots__ don't work
........
r67015 | georg.brandl | 2008-10-25 02:00:52 -0500 (Sat, 25 Oct 2008) | 2 lines
Typo fix.
........
2008-10-25 12:49:17 -03:00
|
|
|
def test_parse_release_file(self):
|
|
|
|
|
|
|
|
for input, output in (
|
|
|
|
# Examples of release file contents:
|
|
|
|
('SuSE Linux 9.3 (x86-64)', ('SuSE Linux ', '9.3', 'x86-64')),
|
|
|
|
('SUSE LINUX 10.1 (X86-64)', ('SUSE LINUX ', '10.1', 'X86-64')),
|
|
|
|
('SUSE LINUX 10.1 (i586)', ('SUSE LINUX ', '10.1', 'i586')),
|
|
|
|
('Fedora Core release 5 (Bordeaux)', ('Fedora Core', '5', 'Bordeaux')),
|
|
|
|
('Red Hat Linux release 8.0 (Psyche)', ('Red Hat Linux', '8.0', 'Psyche')),
|
|
|
|
('Red Hat Linux release 9 (Shrike)', ('Red Hat Linux', '9', 'Shrike')),
|
|
|
|
('Red Hat Enterprise Linux release 4 (Nahant)', ('Red Hat Enterprise Linux', '4', 'Nahant')),
|
|
|
|
('CentOS release 4', ('CentOS', '4', None)),
|
|
|
|
('Rocks release 4.2.1 (Cydonia)', ('Rocks', '4.2.1', 'Cydonia')),
|
|
|
|
):
|
|
|
|
self.assertEqual(platform._parse_release_file(input), output)
|
|
|
|
|
|
|
|
def test_sys_version(self):
|
|
|
|
|
|
|
|
platform._sys_version_cache.clear()
|
|
|
|
for input, output in (
|
|
|
|
('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]',
|
|
|
|
('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')),
|
|
|
|
('IronPython 1.0.60816 on .NET 2.0.50727.42',
|
|
|
|
('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')),
|
|
|
|
('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42',
|
|
|
|
('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')),
|
|
|
|
):
|
|
|
|
# branch and revision are not "parsed", but fetched
|
|
|
|
# from sys.subversion. Ignore them
|
|
|
|
(name, version, branch, revision, buildno, builddate, compiler) \
|
|
|
|
= platform._sys_version(input)
|
|
|
|
self.assertEqual(
|
|
|
|
(name, version, '', '', buildno, builddate, compiler), output)
|
|
|
|
|
2005-11-21 13:48:12 -04:00
|
|
|
def test_main():
|
2008-05-20 18:35:26 -03:00
|
|
|
support.run_unittest(
|
2005-11-21 13:48:12 -04:00
|
|
|
PlatformTest
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_main()
|