예제 #1
0
 def test_single_modifier(self):
     """
     Test use of a single modifier
     """
     from velouria.config import parse_keymapping
     from gi.repository import Gdk
     
     expected = {
         'key': Gdk.KEY_q,
         'modifiers': Gdk.ModifierType.CONTROL_MASK,
     }
     
     self.assertEqual(expected, parse_keymapping('CONTROL_MASK+KEY_q'))
예제 #2
0
 def test_multiple_modifiers(self):
     """
     Test use of several modifiers
     """
     from velouria.config import parse_keymapping
     from gi.repository import Gdk
     
     expected = {
         'key': Gdk.KEY_q,
         'modifiers': Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.META_MASK,
     }
     
     self.assertEqual(expected, parse_keymapping('CONTROL_MASK+META_MASK+KEY_q'))
예제 #3
0
 def test_typical(self):
     """
     Test typical successful use
     """
     from velouria.config import parse_keymapping
     from gi.repository import Gdk
     
     expected = {
         'key': Gdk.KEY_space,
         'modifiers': 0,
     }
     
     self.assertEqual(expected, parse_keymapping('KEY_space'))