Ejemplo n.º 1
0
 def test_disabled(self):
     '''
         Test to check to see if the named
         service is disabled to start on boot
     '''
     mock = MagicMock(side_effect=[False, True])
     with patch.object(win_service, 'enabled', mock):
         self.assertTrue(win_service.disabled('spongebob'))
         self.assertFalse(win_service.disabled('squarepants'))
Ejemplo n.º 2
0
 def test_disabled(self):
     """
         Test to check to see if the named
         service is disabled to start on boot
     """
     mock = MagicMock(side_effect=[False, True])
     with patch.object(win_service, "enabled", mock):
         self.assertTrue(win_service.disabled("spongebob"))
         self.assertFalse(win_service.disabled("squarepants"))
Ejemplo n.º 3
0
 def test_disabled(self):
     '''
         Test to check to see if the named
         service is disabled to start on boot
     '''
     mock = MagicMock(side_effect=[False, True])
     with patch.object(win_service, 'enabled', mock):
         self.assertTrue(win_service.disabled('spongebob'))
         self.assertFalse(win_service.disabled('squarepants'))
Ejemplo n.º 4
0
    def test_disabled(self):
        '''
            Test to check to see if the named
            service is disabled to start on boot
        '''
        mock = MagicMock(side_effect=["DEMAND_START", "DISABLED", ""])
        with patch.dict(win_service.__salt__, {'cmd.run': mock}):
            self.assertTrue(win_service.disabled("salt"))

            self.assertTrue(win_service.disabled("salt"))

            self.assertFalse(win_service.disabled("salt"))
Ejemplo n.º 5
0
    def test_disabled(self):
        '''
            Test to check to see if the named
            service is disabled to start on boot
        '''
        mock = MagicMock(side_effect=["DEMAND_START", "DISABLED", ""])
        with patch.dict(win_service.__salt__, {'cmd.run': mock}):
            self.assertTrue(win_service.disabled("salt"))

            self.assertTrue(win_service.disabled("salt"))

            self.assertFalse(win_service.disabled("salt"))