예제 #1
0
 def test_getall(self):
     """
     Test for Return all available boot services
     """
     disabled_service = 'disabled'
     enabled_service = 'enabled'
     service_list = self.__services({disabled_service: [],
                                     enabled_service: ['default']})
     mock = MagicMock(return_value=service_list)
     with patch.dict(gentoo_service.__salt__, {'cmd.run': mock}):
         all_services = gentoo_service.get_all()
         self.assertEqual(len(all_services), 2)
         self.assertTrue(disabled_service in all_services)
         self.assertTrue(enabled_service in all_services)
예제 #2
0
 def test_getall(self):
     '''
     Test for Return all available boot services
     '''
     disabled_service = 'disabled'
     enabled_service = 'enabled'
     service_list = self.__services({disabled_service: [],
                                     enabled_service: ['default']})
     mock = MagicMock(return_value=service_list)
     with patch.dict(gentoo_service.__salt__, {'cmd.run': mock}):
         all_services = gentoo_service.get_all()
         self.assertEqual(len(all_services), 2)
         self.assertTrue(disabled_service in all_services)
         self.assertTrue(enabled_service in all_services)
예제 #3
0
 def test_getall(self):
     """
     Test for Return all available boot services
     """
     disabled_service = "disabled"
     enabled_service = "enabled"
     service_list = self.__services({
         disabled_service: [],
         enabled_service: ["default"]
     })
     mock = MagicMock(return_value=service_list)
     with patch.dict(gentoo_service.__salt__, {"cmd.run": mock}):
         all_services = gentoo_service.get_all()
         self.assertEqual(len(all_services), 2)
         self.assertTrue(disabled_service in all_services)
         self.assertTrue(enabled_service in all_services)