コード例 #1
0
ファイル: test_keyboard.py プロジェクト: vindir/salt
 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
ファイル: keyboard_test.py プロジェクト: bryson/salt
 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")