def test_suggestions(keyhint, key_config_stub):
 key_config_stub.set_bindings_for('normal', OrderedDict([('aa', 'cmd-aa'), ('ab', 'cmd-ab'), ('aba', 'cmd-aba'), ('abb', 'cmd-abb'), ('xd', 'cmd-xd'), ('xe', 'cmd-xe')]))
 keyhint.update_keyhint('normal', 'a')
 assert (keyhint.text() == expected_text(('a', 'yellow', 'a', 'cmd-aa'), ('a', 'yellow', 'b', 'cmd-ab'), ('a', 'yellow', 'ba', 'cmd-aba'), ('a', 'yellow', 'bb', 'cmd-abb')))

def test_suggestions ( keyhint , key_config_stub ) : key_config_stub . set_bindings_for ( 'normal' , OrderedDict ( [ ( 'aa' , 'cmd-aa' ) , ( 'ab' , 'cmd-ab' ) , ( 'aba' , 'cmd-aba' ) , ( 'abb' , 'cmd-abb' ) , ( 'xd' , 'cmd-xd' ) , ( 'xe' , 'cmd-xe' ) ] ) ) keyhint . update_keyhint ( 'normal' , 'a' ) assert ( keyhint . text ( ) == expected_text ( ( 'a' , 'yellow' , 'a' , 'cmd-aa' ) , ( 'a' , 'yellow' , 'b' , 'cmd-ab' ) , ( 'a' , 'yellow' , 'ba' , 'cmd-aba' ) , ( 'a' , 'yellow' , 'bb' , 'cmd-abb' ) ) )
test that keyhints are shown based on a prefix .