]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added the test for issue3762.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 6 Oct 2008 01:57:03 +0000 (01:57 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 6 Oct 2008 01:57:03 +0000 (01:57 +0000)
Lib/test/test_platform.py

index 265c5272df4889174d3bae09d2f1020e44c1dd57..5024737db95a573beb401b7188a2ad155d2eb78a 100644 (file)
@@ -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()