def test_restart(self): """ Test to restart the specified service """ with patch.object(os.path, "join", return_value="A"): with patch.object(service, "run", MagicMock(return_value=True)): self.assertTrue(service.restart("name"))
def test_restart(self): ''' Test to restart the specified service ''' with patch.object(os.path, 'join', return_value='A'): with patch.object(service, 'run', MagicMock(return_value=True)): self.assertTrue(service.restart('name'))
def test_restart(self): ''' Test to restart the specified service ''' with patch.object(os.path, 'join', return_value='A'): with patch.dict(service.__salt__, {'cmd.retcode': MagicMock(return_value=False)}): self.assertTrue(service.restart('name'))
def test_restart(self): ''' Test to restart the specified service ''' with patch.object(os.path, 'join', return_value='A'): with patch.dict(service.__salt__, {'cmd.retcode': MagicMock(return_value=False)}): self.assertTrue(service.restart('name'))