Пример #1
0
 def test_restart(self):
     """
     Test for Restart the named service
     """
     mock = MagicMock(return_value=True)
     with patch.dict(gentoo_service.__salt__, {'cmd.retcode': mock}):
         self.assertFalse(gentoo_service.restart('name'))
     mock.assert_called_once_with('/etc/init.d/name restart', python_shell=False)
Пример #2
0
 def test_restart(self):
     """
     Test for Restart the named service
     """
     mock = MagicMock(return_value=True)
     with patch.dict(gentoo_service.__salt__, {'cmd.retcode': mock}):
         self.assertFalse(gentoo_service.restart('name'))
     mock.assert_called_once_with('/etc/init.d/name restart', python_shell=False)