Esempio n. 1
0
 def run():
     for entered, match_type in expected:
         sequence = keyutils.KeySequence.parse(entered)
         command = ("eeloo"
                    if match_type == QKeySequence.ExactMatch else None)
         result = basekeyparser.MatchResult(match_type=match_type,
                                            command=command,
                                            sequence=sequence)
         assert trie.matches(sequence) == result
Esempio n. 2
0
def test_matches_single(entered, configured, match_type):
    entered = keyutils.KeySequence.parse(entered)
    configured = keyutils.KeySequence.parse(configured)
    trie = basekeyparser.BindingTrie()
    trie[configured] = "eeloo"
    command = "eeloo" if match_type == QKeySequence.ExactMatch else None
    result = basekeyparser.MatchResult(match_type=match_type,
                                       command=command,
                                       sequence=entered)
    assert trie.matches(entered) == result