[pre-commit.ci] auto fixes from pre-commit.com hooks
[git-cola.git] / test / switcher_test.py
blobded8ad57f93fe24a1f5042c1f090e9ff74240436
1 """Test Quick Switcher"""
2 # pylint: disable=redefined-outer-name
4 from cola import icons
5 from cola.widgets import switcher
8 def test_switcher_item_with_only_key():
9 """item text would be key by building item without name"""
10 key = 'item-key'
11 actual = switcher.switcher_item(key)
13 assert actual.key == key
14 assert actual.text() == key
17 def test_switcher_item_with_key_name_icon():
18 """item text would be name by building item with key and name"""
19 key = 'item-key'
20 name = 'item-name'
21 icon = icons.folder()
23 actual = switcher.switcher_item(key, icon, name)
25 assert actual.key == key
26 assert actual.text() == name