From: Hirokazu Yamamoto Date: Mon, 6 Oct 2008 01:57:03 +0000 (+0000) Subject: Added the test for issue3762. X-Git-Tag: v2.7a1~2768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e5e50104c90501477e1ecc739e563f0f9b1129d;p=thirdparty%2FPython%2Fcpython.git Added the test for issue3762. --- diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 265c5272df48..5024737db95a 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()