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

This commit is contained in:
Hirokazu Yamamoto 2008-10-06 02:41:59 +00:00
parent 6e5e50104c
commit 18c4e8734c
1 changed files with 5 additions and 4 deletions

View File

@ -17,12 +17,13 @@ class PlatformTest(unittest.TestCase):
'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)
real = os.path.realpath(sys.executable)
link = os.path.abspath(test_support.TESTFN)
os.symlink(real, link)
try:
self.assertEqual(get(sys.executable), get(symlink))
self.assertEqual(get(real), get(link))
finally:
os.remove(symlink)
os.remove(link)
def test_machine(self):
res = platform.machine()