git-cola v4.6.0
[git-cola.git] / test / switcher_test.py
blob653e622aecbb55887bd7fb77d97832c180e9b625
1 """Test Quick Switcher"""
2 from cola import icons
3 from cola.widgets import switcher
6 def test_switcher_item_with_only_key():
7 """item text would be key by building item without name"""
8 key = 'item-key'
9 actual = switcher.switcher_item(key)
11 assert actual.key == key
12 assert actual.text() == key
15 def test_switcher_item_with_key_name_icon():
16 """item text would be name by building item with key and name"""
17 key = 'item-key'
18 name = 'item-name'
19 icon = icons.folder()
21 actual = switcher.switcher_item(key, icon, name)
23 assert actual.key == key
24 assert actual.text() == name