CHANGES: document the git config include.path updates
[git-cola.git] / test / display_test.py
blob95220fc1439c09ff182b9ca879435c7c84550785
1 #!/usr/bin/env python
2 from __future__ import absolute_import, division, unicode_literals
4 import pytest
6 from cola import display
9 def test_shorten_paths():
10 paths = (
11 '/usr/src/git-cola/src',
12 '/usr/src/example/src',
13 '/usr/src/super/lib/src',
14 '/usr/src/super/tools/src',
15 '/usr/src/super/example/src',
16 '/lib/src',
18 actual = display.shorten_paths(paths)
19 assert actual[paths[0]] == 'git-cola/src'
20 assert actual[paths[1]] == 'src/example/src'
21 assert actual[paths[2]] == 'super/lib/src'
22 assert actual[paths[3]] == 'tools/src'
23 assert actual[paths[4]] == 'super/example/src'
24 assert actual[paths[5]] == '/lib/src'
27 def test_normalize_path():
28 path = r'C:\games\doom2'
29 expect = 'C:/games/doom2'
30 actual = display.normalize_path(path)
31 assert expect == actual
34 if __name__ == '__main__':
35 pytest.main([__file__])