[Python-checkins] commit of r41353 - python/trunk/Lib/test

tim.peters@python.org tim.peters at python.org
Sun Oct 30 02:15:39 CET 2005


Author: tim.peters
Date: Sun Oct 30 02:15:38 2005
New Revision: 41353

Modified:
   python/trunk/Lib/test/test_cmd_line.py
Log:
test_directories():  This test had no chance of passing on
Windows.  Hacked it to pass, but not sure it's worth the
bother.


Modified: python/trunk/Lib/test/test_cmd_line.py
==============================================================================
--- python/trunk/Lib/test/test_cmd_line.py	(original)
+++ python/trunk/Lib/test/test_cmd_line.py	Sun Oct 30 02:15:38 2005
@@ -12,8 +12,20 @@
         return data
 
     def test_directories(self):
-        self.assertTrue('is a directory' in self.start_python('.'))
-        self.assertTrue('is a directory' in self.start_python('< .'))
+        # Does this test make sense?  The message for "< ."  may depend on
+        # the command shell, and the message for "." depends on the OS.
+        if sys.platform.startswith("win"):
+            # On WinXP w/ cmd.exe,
+            #    "< ." gives "Access is denied.\n"
+            #    "."   gives "C:\\Code\\python\\PCbuild\\python.exe: " +
+            #                "can't open file '.':" +
+            #                "[Errno 13] Permission denied\n"
+            lookfor = " denied"  # common to both cases
+        else:
+            # This is what the test looked for originally, on all platforms.
+            lookfor = "is a directory"
+        self.assertTrue(lookfor in self.start_python('.'))
+        self.assertTrue(lookfor in self.start_python('< .'))
 
     def verify_valid_flag(self, cmd_line):
         data = self.start_python(cmd_line)


More information about the Python-checkins mailing list