contrib: remove all references to Python 2.6 and travis-build
[git-cola.git] / test / display_test.py
blob531d999afc61ec75bd4feca00c8ba6c13a52a8c4
1 from __future__ import absolute_import, division, unicode_literals
3 from cola import display
6 def test_shorten_paths():
7 paths = (
8 '/usr/src/git-cola/src',
9 '/usr/src/example/src',
10 '/usr/src/super/lib/src',
11 '/usr/src/super/tools/src',
12 '/usr/src/super/example/src',
13 '/lib/src',
15 actual = display.shorten_paths(paths)
16 assert actual[paths[0]] == 'git-cola/src'
17 assert actual[paths[1]] == 'src/example/src'
18 assert actual[paths[2]] == 'super/lib/src'
19 assert actual[paths[3]] == 'tools/src'
20 assert actual[paths[4]] == 'super/example/src'
21 assert actual[paths[5]] == '/lib/src'
24 def test_normalize_path():
25 path = r'C:\games\doom2'
26 expect = 'C:/games/doom2'
27 actual = display.normalize_path(path)
28 assert expect == actual