Exemplo n.º 1
0
 def test_set_settings(self):
   keymap = kb.findCurrentKeymap()
   numlock = kb.isNumLockEnabledByDefault()
   ibus = kb.isIbusEnabledByDefault()
   self.assertEqual(kb.setDefaultKeymap('fr-latin1'), 0)
   self.assertEqual(kb.findCurrentKeymap(), 'fr-latin1')
   self.assertEqual(kb.setNumLockDefault(True), 0)
   self.assertTrue(kb.isNumLockEnabledByDefault())
   self.assertEqual(kb.setIbusDefault(True), 0)
   self.assertTrue(kb.isIbusEnabledByDefault())
   # restore actual keyboard parameters
   kb.setDefaultKeymap(keymap)
   kb.setNumLockDefault(numlock)
   kb.setIbusDefault(ibus)
Exemplo n.º 2
0
 def test_current_settings(self):
   keymap = kb.findCurrentKeymap()
   self.assertTrue(keymap)
   numlock = kb.isNumLockEnabledByDefault()
   self.assertIsInstance(numlock, bool)
   ibus = kb.isIbusEnabledByDefault()
   self.assertIsInstance(ibus, bool)