Skip to content

Commit aed93cd

Browse files
committed
i dont think get_link_path should normcase paths
1 parent 186d159 commit aed93cd

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/robot/utils/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def get_link_path(target, base):
114114
return url.replace('%5C', '/').replace('%3A', ':').replace('|', ':')
115115

116116
def _get_pathname(target, base):
117-
target = normpath(target)
118-
base = normpath(base)
117+
target = normpath(target, normcase=False)
118+
base = normpath(base, normcase=False)
119119
if os.path.isfile(base):
120120
base = os.path.dirname(base)
121121
if base == target:

utest/utils/test_misc.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@ def test_get_link_path(self):
5454
( 'c:\\path\\to', 'c:\\path\\to\\result_in_same_dir.html', 'result_in_same_dir.html' ),
5555
( 'c:\\path\\to\\dir', 'c:\\path\\to\\result_in_parent_dir.html', '../result_in_parent_dir.html' ),
5656
( 'c:\\path\\to', 'c:\\path\\to\\dir\\result_in_sub_dir.html', 'dir/result_in_sub_dir.html' ),
57-
( 'c:\\commonprefix\\sucks\\baR', 'c:\\commonprefix\\sucks\\baZ.txt', '../baz.txt' ),
57+
( 'c:\\commonprefix\\sucks\\baR', 'c:\\commonprefix\\sucks\\baZ.txt', '../baZ.txt' ),
5858
( 'c:\\a\\very\\long\\path', 'c:\\no\\depth\\limitation', '../../../../no/depth/limitation' ),
5959
( 'c:\\windows\\explorer.exe', 'c:\\windows\\path\\to\\existing\\file', 'path/to/existing/file' ),
6060
( 'c:\\path\\to\\identity', 'c:\\path\\to\\identity', 'identity' ),
6161
]
62-
import robot.utils.normalizing
6362
for basedir, target, expected in inputs:
64-
if robot.utils.normalizing._CASE_INSENSITIVE_FILESYSTEM :
65-
expected = expected.lower()
6663
assert_equals(get_link_path(target, basedir).replace('R:', 'r:'), expected,
6764
'%s -> %s' % (target, basedir))
6865

0 commit comments

Comments
 (0)