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')
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")
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")