Exemple #1
0
    def test_stop(self):
        '''
        Test for Stop the specified service
        '''
        with patch.object(launchctl,
                          '_service_by_name',
                          return_value={'file_path': 'A'}):
            with patch.dict(launchctl.__salt__,
                            {'cmd.retcode': MagicMock(return_value=False)}):
                self.assertTrue(launchctl.stop('job_label'))

        with patch.object(launchctl, '_service_by_name', return_value=None):
            self.assertFalse(launchctl.stop('job_label'))
Exemple #2
0
    def test_stop(self):
        '''
        Test for Stop the specified service
        '''
        with patch.object(launchctl,
                          '_service_by_name',
                          return_value={'file_path': 'A'}):
            with patch.dict(launchctl.__salt__,
                            {'cmd.retcode': MagicMock(return_value=False)}):
                self.assertTrue(launchctl.stop('job_label'))

        with patch.object(launchctl,
                          '_service_by_name',
                          return_value=None):
            self.assertFalse(launchctl.stop('job_label'))