summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-06 01:57:03 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-06 01:57:03 (GMT)
commit6e5e50104c90501477e1ecc739e563f0f9b1129d (patch)
tree807cb7496af0f046ef0c832779809e90baa8726b
parentdcf3b1c79a95cd3d29cae6a99fcc8f752ee9281a (diff)
downloadcpython-6e5e50104c90501477e1ecc739e563f0f9b1129d.zip
cpython-6e5e50104c90501477e1ecc739e563f0f9b1129d.tar.gz
cpython-6e5e50104c90501477e1ecc739e563f0f9b1129d.tar.bz2
Added the test for issue3762.
-rw-r--r--Lib/test/test_platform.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 265c527..5024737 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,20 @@ 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()
+ symlink = os.path.abspath(test_support.TESTFN)
+ os.symlink(sys.executable, symlink)
+ try:
+ self.assertEqual(get(sys.executable), get(symlink))
+ finally:
+ os.remove(symlink)
+
def test_machine(self):
res = platform.machine()