summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2005-10-30 01:15:38 (GMT)
committerTim Peters <tim.peters@gmail.com>2005-10-30 01:15:38 (GMT)
commit383d3c0a68bb17aa4d4bdc9081c4b6d016937aec (patch)
treee6b945eacca115a1e32c5352b306ef0ddbbaa0a6
parent39914b172e88b80df1b08a4b19eaae19f3b11281 (diff)
downloadcpython-383d3c0a68bb17aa4d4bdc9081c4b6d016937aec.zip
cpython-383d3c0a68bb17aa4d4bdc9081c4b6d016937aec.tar.gz
cpython-383d3c0a68bb17aa4d4bdc9081c4b6d016937aec.tar.bz2
test_directories(): This test had no chance of passing on
Windows. Hacked it to pass, but not sure it's worth the bother.
-rw-r--r--Lib/test/test_cmd_line.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index a4a78f5..ccf7081 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -12,8 +12,20 @@ class CmdLineTest(unittest.TestCase):
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)