예제 #1
0
 def test_get_sys(self):
     '''
     Test if it get current system keyboard setting
     '''
     mock = MagicMock(return_value='X11 Layout=us')
     with patch.dict(keyboard.__salt__, {'cmd.run': mock}):
         self.assertEqual(keyboard.get_sys(), 'us')
예제 #2
0
 def test_get_sys(self):
     """
     Test if it get current system keyboard setting
     """
     mock = MagicMock(return_value="X11 Layout=us")
     with patch.dict(keyboard.__salt__, {"cmd.run": mock}):
         self.assertEqual(keyboard.get_sys(), "us")
예제 #3
0
 def test_get_sys(self):
     """
     Test if it get current system keyboard setting
     """
     mock = MagicMock(return_value="X11 Layout=us")
     with patch.dict(keyboard.__grains__, {"os_family": "RedHat"}):
         with patch.dict(keyboard.__salt__, {"cmd.run": mock}):
             self.assertEqual(keyboard.get_sys(), "us")