Пример #1
0
 def setUp(self):
     super(TestPowerQuery, self).setUp()
     self.useFixture(EventTypesAllRegistered())
     self.patch(power, "deferToThread", maybeDeferred)
     for _, power_driver in PowerDriverRegistry:
         self.patch(power_driver,
                    "detect_missing_packages").return_value = []
Пример #2
0
 def setUp(self):
     super(TestMaybeChangePowerState, self).setUp()
     self.patch(power, 'power_action_registry', {})
     for _, power_driver in PowerDriverRegistry:
         self.patch(
             power_driver, "detect_missing_packages").return_value = []
     self.useFixture(EventTypesAllRegistered())
Пример #3
0
 def setUp(self):
     super().setUp()
     self.useFixture(EventTypesAllRegistered())
     self.patch(power, "deferToThread", maybeDeferred)
     for _, power_driver in PowerDriverRegistry:
         self.patch(power_driver,
                    "detect_missing_packages").return_value = []
     self.patch(clusterservice,
                "get_all_interfaces_definition").return_value = {}
Пример #4
0
 def setUp(self):
     super(TestMaybeChangePowerState, self).setUp()
     self.patch(power, 'power_action_registry', {})
     for _, power_driver in PowerDriverRegistry:
         self.patch(power_driver,
                    "detect_missing_packages").return_value = []
     self.useFixture(EventTypesAllRegistered())
     # Defer later won't run during the test so replace it with a
     # maybeDeferred.
     self.patch(power, 'deferLater').side_effect = (
         lambda clock, delay, func, *args, **kwargs: maybeDeferred(
             func, *args, **kwargs))
Пример #5
0
 def setUp(self):
     super().setUp()
     self.patch(power, "power_action_registry", {})
     for _, power_driver in PowerDriverRegistry:
         self.patch(power_driver,
                    "detect_missing_packages").return_value = []
     self.useFixture(EventTypesAllRegistered())
     # Defer later won't run during the test so replace it with a
     # maybeDeferred.
     self.patch(
         power, "deferLater"
     ).side_effect = lambda clock, delay, func, *args, **kwargs: maybeDeferred(
         func, *args, **kwargs)
     self.patch(clusterservice,
                "get_all_interfaces_definition").return_value = {}
Пример #6
0
 def setUp(self):
     super().setUp()
     self.useFixture(EventTypesAllRegistered())
Пример #7
0
 def setUp(self):
     super(TestPowerHelpers, self).setUp()
     self.useFixture(EventTypesAllRegistered())
Пример #8
0
 def setUp(self):
     super(TestChangePowerState, self).setUp()
     self.useFixture(EventTypesAllRegistered())
Пример #9
0
 def setUp(self):
     super().setUp()
     self.useFixture(EventTypesAllRegistered())
     self.patch(clusterservice,
                "get_all_interfaces_definition").return_value = {}