Commit 801e93ff authored by Hirokazu Yamamoto's avatar Hirokazu Yamamoto

Added the test for issue3762.

parent 8445761d
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment