Пример #1
0
 def test_get_disabled(self):
     """
     Test for Return a list of service that are installed but disabled
     """
     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}):
         disabled_services = gentoo_service.get_disabled()
         self.assertTrue(len(disabled_services), 1)
         self.assertTrue(disabled_service in disabled_services)
Пример #2
0
 def test_get_disabled(self):
     '''
     Test for Return a list of service that are installed but disabled
     '''
     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}):
         disabled_services = gentoo_service.get_disabled()
         self.assertTrue(len(disabled_services), 1)
         self.assertTrue(disabled_service in disabled_services)
Пример #3
0
 def test_get_disabled(self):
     """
     Test for Return a list of service that are installed but disabled
     """
     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}):
         disabled_services = gentoo_service.get_disabled()
         self.assertTrue(len(disabled_services), 1)
         self.assertTrue(disabled_service in disabled_services)