summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-09 18:06:58 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-09 18:06:58 (GMT)
commit2c66b7cd9f314395d7f8ec46a3fab3c19d02bb4d (patch)
tree2eb636986f0721ce1fa64596e36ea1ad2cc2ebf0 /Lib/test/test_platform.py
parent6b23e5a315a95b74f2a3ad3a630fd1bf2f869444 (diff)
downloadcpython-2c66b7cd9f314395d7f8ec46a3fab3c19d02bb4d.zip
cpython-2c66b7cd9f314395d7f8ec46a3fab3c19d02bb4d.tar.gz
cpython-2c66b7cd9f314395d7f8ec46a3fab3c19d02bb4d.tar.bz2
Merged revisions 66809-66810,66835,66862-66863 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r66809 | hirokazu.yamamoto | 2008-10-06 10:57:03 +0900 | 1 line Added the test for issue3762. ........ r66810 | hirokazu.yamamoto | 2008-10-06 11:41:59 +0900 | 1 line More strict test. Consider the case sys.executable itself is symlink. ........ r66835 | hirokazu.yamamoto | 2008-10-08 03:10:47 +0900 | 1 line more intensive test on dbm. ........ r66862 | hirokazu.yamamoto | 2008-10-09 19:00:30 +0900 | 3 lines On windows, os.chdir given unicode was not working if GetCurrentDirectoryW returned a path longer than MAX_PATH. (But It's doubtful this code path is really executed because I cannot move to such directory on win2k) ........ r66863 | hirokazu.yamamoto | 2008-10-09 19:11:21 +0900 | 1 line r66862 contained memory leak. ........
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r--Lib/test/test_platform.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 265c527..2fa1309 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -2,6 +2,7 @@ import sys
import os
import unittest
import platform
+import subprocess
from test import test_support
@@ -9,6 +10,21 @@ class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
+ 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(test_support.TESTFN)
+ os.symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ os.remove(link)
+
def test_machine(self):
res = platform.machine()