mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the
directory containing a backslash.
This commit is contained in:
parent
624caf7bcb
commit
5106d044ec
2 changed files with 5 additions and 4 deletions
|
@ -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]
|
||||
tester('ntpath.relpath("a")', 'a')
|
||||
tester('ntpath.relpath(os.path.abspath("a"))', 'a')
|
||||
tester('ntpath.relpath("a/b")', 'a\\b')
|
||||
tester('ntpath.relpath("../a/b")', '..\\a\\b')
|
||||
tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')
|
||||
tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')
|
||||
with support.temp_cwd(support.TESTFN) as cwd_dir:
|
||||
currentdir = os.path.basename(cwd_dir)
|
||||
tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')
|
||||
tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')
|
||||
tester('ntpath.relpath("a", "b/c")', '..\\..\\a')
|
||||
tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat')
|
||||
tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue