Improve keyhint tests
This also brings them back to 100% coverage
This commit is contained in:
parent
02accf3e71
commit
ab7cbfdea0
@ -61,6 +61,21 @@ def keyhint(qtbot, config_stub, key_config_stub):
|
|||||||
return keyhint
|
return keyhint
|
||||||
|
|
||||||
|
|
||||||
|
def test_show_and_hide(qtbot, keyhint):
|
||||||
|
with qtbot.waitSignal(keyhint.update_geometry):
|
||||||
|
keyhint.show()
|
||||||
|
qtbot.waitForWindowShown(keyhint)
|
||||||
|
keyhint.update_keyhint('normal', '')
|
||||||
|
assert not keyhint.isVisible()
|
||||||
|
|
||||||
|
|
||||||
|
def test_position_change(keyhint, config_stub):
|
||||||
|
config_stub.set('ui', 'status-position', 'top')
|
||||||
|
stylesheet = keyhint.styleSheet()
|
||||||
|
assert 'border-bottom-right-radius' in stylesheet
|
||||||
|
assert 'border-top-right-radius' not in stylesheet
|
||||||
|
|
||||||
|
|
||||||
def test_suggestions(keyhint, key_config_stub):
|
def test_suggestions(keyhint, key_config_stub):
|
||||||
"""Test that keyhints are shown based on a prefix."""
|
"""Test that keyhints are shown based on a prefix."""
|
||||||
# we want the dict to return sorted items() for reliable testing
|
# we want the dict to return sorted items() for reliable testing
|
||||||
|
Loading…
Reference in New Issue
Block a user