Beispiel #1
0
 def test_get_disabled(self):
     """
         Test to return the disabled services
     """
     mock = MagicMock(return_value=[
         {
             "ServiceName": "spongebob"
         },
         {
             "ServiceName": "squarepants"
         },
         {
             "ServiceName": "patrick"
         },
     ])
     with patch.object(win_service, "_get_services", mock):
         mock_info = MagicMock(side_effect=[
             {
                 "StartType": "Auto"
             },
             {
                 "StartType": "Manual"
             },
             {
                 "StartType": "Disabled"
             },
         ])
         with patch.object(win_service, "info", mock_info):
             self.assertListEqual(win_service.get_disabled(),
                                  ["patrick", "squarepants"])
Beispiel #2
0
 def test_get_disabled(self):
     '''
         Test to return the disabled services
     '''
     mock = MagicMock(return_value=['c', 'a', 'b'])
     with patch.object(win_service, 'get_all', mock):
         mock = MagicMock(side_effect=[True, False, True])
         with patch.object(win_service, 'disabled', mock):
             self.assertListEqual(win_service.get_disabled(), ['b', 'c'])
Beispiel #3
0
 def test_get_disabled(self):
     '''
         Test to return the disabled services
     '''
     mock = MagicMock(return_value=['c', 'a', 'b'])
     with patch.object(win_service, 'get_all', mock):
         mock = MagicMock(side_effect=[True, False, True])
         with patch.object(win_service, 'disabled', mock):
             self.assertListEqual(win_service.get_disabled(), ['b', 'c'])
Beispiel #4
0
 def test_get_disabled(self):
     '''
         Test to return the disabled services
     '''
     mock = MagicMock(return_value=[{'ServiceName': 'spongebob'},
                                    {'ServiceName': 'squarepants'},
                                    {'ServiceName': 'patrick'}])
     with patch.object(win_service, '_get_services', mock):
         mock_info = MagicMock(side_effect=[{'StartType': 'Auto'},
                                            {'StartType': 'Manual'},
                                            {'StartType': 'Disabled'}])
         with patch.object(win_service, 'info', mock_info):
             self.assertListEqual(win_service.get_disabled(),
                                  ['patrick', 'squarepants'])
Beispiel #5
0
 def test_get_disabled(self):
     '''
         Test to return the disabled services
     '''
     mock = MagicMock(return_value=[{'ServiceName': 'spongebob'},
                                    {'ServiceName': 'squarepants'},
                                    {'ServiceName': 'patrick'}])
     with patch.object(win_service, '_get_services', mock):
         mock_info = MagicMock(side_effect=[{'StartType': 'Auto'},
                                            {'StartType': 'Manual'},
                                            {'StartType': 'Disabled'}])
         with patch.object(win_service, 'info', mock_info):
             self.assertListEqual(win_service.get_disabled(),
                                  ['patrick', 'squarepants'])