def test_start(self):
        """
        Test to start the specified service
        """
        with patch.dict(
                smf.__salt__,
            {"cmd.retcode": MagicMock(side_effect=[False, 3, None, False, 4])},
        ):
            self.assertTrue(smf.start("name"))

            self.assertTrue(smf.start("name"))

            self.assertFalse(smf.start("name"))
示例#2
0
    def test_start(self):
        '''
        Test to start the specified service
        '''
        with patch.dict(
                smf.__salt__,
            {'cmd.retcode': MagicMock(side_effect=[False, 3, None, False, 4])
             }):
            self.assertTrue(smf.start('name'))

            self.assertTrue(smf.start('name'))

            self.assertFalse(smf.start('name'))