1 from cola
import display
4 def test_shorten_paths():
6 '/usr/src/git-cola/src',
7 '/usr/src/example/src',
8 '/usr/src/super/lib/src',
9 '/usr/src/super/tools/src',
10 '/usr/src/super/example/src',
13 actual
= display
.shorten_paths(paths
)
14 assert actual
[paths
[0]] == 'git-cola/src'
15 assert actual
[paths
[1]] == 'src/example/src'
16 assert actual
[paths
[2]] == 'super/lib/src'
17 assert actual
[paths
[3]] == 'tools/src'
18 assert actual
[paths
[4]] == 'super/example/src'
19 assert actual
[paths
[5]] == '/lib/src'
22 def test_normalize_path():
23 path
= r
'C:\games\doom2'
24 expect
= 'C:/games/doom2'
25 actual
= display
.normalize_path(path
)
26 assert expect
== actual