Kaydet (Commit) 18c4e873 authored tarafından Hirokazu Yamamoto's avatar Hirokazu Yamamoto

More strict test. Consider the case sys.executable itself is symlink.

üst 6e5e5010
...@@ -17,12 +17,13 @@ class PlatformTest(unittest.TestCase): ...@@ -17,12 +17,13 @@ class PlatformTest(unittest.TestCase):
'import platform; print platform.architecture()'] 'import platform; print platform.architecture()']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE) p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
return p.communicate() return p.communicate()
symlink = os.path.abspath(test_support.TESTFN) real = os.path.realpath(sys.executable)
os.symlink(sys.executable, symlink) link = os.path.abspath(test_support.TESTFN)
os.symlink(real, link)
try: try:
self.assertEqual(get(sys.executable), get(symlink)) self.assertEqual(get(real), get(link))
finally: finally:
os.remove(symlink) os.remove(link)
def test_machine(self): def test_machine(self):
res = platform.machine() 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