mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Added the test for issue3762.
This commit is contained in:
parent
dcf3b1c79a
commit
6e5e50104c
1 changed files with 15 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue