コード例 #1
0
    def _test_disable_compute_service(self, mock_enable_disable):
        task = host_failure.DisableComputeServiceTask(self.ctxt,
                                                      self.novaclient)
        task.execute(self.instance_host)

        mock_enable_disable.assert_called_once_with(self.ctxt,
                                                    self.instance_host)
コード例 #2
0
    def _test_disable_compute_service(self):
        task = host_failure.DisableComputeServiceTask(self.novaclient)
        with mock.patch.object(
            self.novaclient,
            "enable_disable_service") as mock_enable_disable_service:
            task.execute(self.ctxt, self.instance_host)

        mock_enable_disable_service.assert_called_once_with(
            self.ctxt, self.instance_host)