diff options
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-10-06 02:41:59 (GMT) | 
|---|---|---|
| committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-10-06 02:41:59 (GMT) | 
| commit | 18c4e8734c7d817163e2c6564eedc246a2c9aa58 (patch) | |
| tree | 903479501562b40a1f915e307d9aace19ca93b35 | |
| parent | 6e5e50104c90501477e1ecc739e563f0f9b1129d (diff) | |
| download | cpython-18c4e8734c7d817163e2c6564eedc246a2c9aa58.zip cpython-18c4e8734c7d817163e2c6564eedc246a2c9aa58.tar.gz cpython-18c4e8734c7d817163e2c6564eedc246a2c9aa58.tar.bz2  | |
More strict test. Consider the case sys.executable itself is symlink.
| -rw-r--r-- | Lib/test/test_platform.py | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 5024737..2fa1309 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -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()  | 
