summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-06 04:51:11 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-10-06 04:51:11 (GMT)
commite674840916680f569994ad64a2cfefe710668c55 (patch)
treeda4d4a8df5e3a531b489c48a2a57202ac75a9cda /Lib/test
parenteba99dfde8b30e0671200b0dc52eccec91cf7cb3 (diff)
downloadcpython-e674840916680f569994ad64a2cfefe710668c55.zip
cpython-e674840916680f569994ad64a2cfefe710668c55.tar.gz
cpython-e674840916680f569994ad64a2cfefe710668c55.tar.bz2
Added the test for issue3762.
Diffstat (limited to 'Lib/test')
-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 8ef34ad..4b4c0fa 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 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(support.TESTFN)
+ os.symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ os.remove(link)
+
def test_machine(self):
res = platform.machine()