cpython: 1db1cd711104 (original) (raw)
Mercurial > cpython
changeset 94294:1db1cd711104
Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the directory containing a backslash. [#7665]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Mon, 26 Jan 2015 10:26:29 +0200 |
parents | 9b0b6804528d(current diff)04fa56628830(diff) |
children | c347c21e5afa |
files | Lib/test/test_urllib2.py |
diffstat | 2 files changed, 5 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_ntpath.py 7 Lib/test/test_urllib2.py 2 |
line wrap: on
line diff
--- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -306,13 +306,14 @@ class TestNtpath(unittest.TestCase): self.skipTest('nt module not available') def test_relpath(self):
currentdir = os.path.split(os.getcwd())[-1][](#l1.7) tester('ntpath.relpath("a")', 'a')[](#l1.8) tester('ntpath.relpath(os.path.abspath("a"))', 'a')[](#l1.9) tester('ntpath.relpath("a/b")', 'a\\b')[](#l1.10) tester('ntpath.relpath("../a/b")', '..\\a\\b')[](#l1.11)
tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')[](#l1.12)
tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')[](#l1.13)
with support.temp_cwd(support.TESTFN) as cwd_dir:[](#l1.14)
currentdir = os.path.basename(cwd_dir)[](#l1.15)
tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')[](#l1.16)
tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')[](#l1.17) tester('ntpath.relpath("a", "b/c")', '..\\..\\a')[](#l1.18) tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat')[](#l1.19) tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')[](#l1.20)
--- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -44,7 +44,7 @@ class TrivialTests(unittest.TestCase): self.assertRaises(ValueError, urllib.request.urlopen, 'bogus url') # XXX Name hacking to get this to work on Windows.
fname = os.path.abspath(urllib.request.__file__).replace('\\', '/')[](#l2.7)
fname = os.path.abspath(urllib.request.__file__).replace(os.sep, '/')[](#l2.8)