README: recommend use of garden
[git-cola.git] / test / display_test.py
blob58a31bc9cc6ffaaa43c7201369605ae682af32f3
1 from cola import display
4 def test_shorten_paths():
5 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',
11 '/lib/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