cpython: 1e12c9e5bc89 (original) (raw)
Mercurial > cpython
changeset 94292:1e12c9e5bc89 2.7
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:00 +0200 |
parents | 2db41d551a4f |
children | 36ca5e765704 |
files | Lib/test/test_ntpath.py 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 @@ -281,13 +281,14 @@ class TestNtpath(unittest.TestCase): tester('ntpath.abspath("C:\")', "C:\") 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 test_support.temp_cwd(test_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("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')[](#l1.19) tester('ntpath.relpath("a", "a")', '.')[](#l1.20)
--- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -25,7 +25,7 @@ class TrivialTests(unittest.TestCase): self.assertRaises(ValueError, urllib2.urlopen, 'bogus url') # XXX Name hacking to get this to work on Windows.
fname = os.path.abspath(urllib2.__file__).replace('\\', '/')[](#l2.7)
fname = os.path.abspath(urllib2.__file__).replace(os.sep, '/')[](#l2.8)
# And more hacking to get it to work on MacOS. This assumes # urllib.pathname2url works, unfortunately...