@mock.patch.object(conductor_manager.ComputeTaskManager, '_live_migrate')
    @mock.patch.object(db, 'service_get_by_compute_host')
    @mock.patch.object(objects.Migration, 'get_by_id_and_instance')
    @mock.patch('nova.compute.manager.ComputeManager.'
                'live_migration_force_complete')
    def test_live_migrate_force_complete(self, live_migration_pause_instance,
                                         get_by_id_and_instance,
                                         service_get_by_compute_host,
                                         _live_migrate):
        migration = objects.Migration()
        migration.id = 1
        migration.status = 'running'
        get_by_id_and_instance.return_value = migration
        self._do_post('servers/%s/action' % self.uuid, 'live-migrate-server',
                      {'hostname': self.compute.host})
        response = self._do_post('servers/%s/migrations/%s/action'
                                 % (self.uuid, '3'), 'force_complete', {})
        self.assertEqual(202, response.status_code)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/functional/api_sample_tests/test_server_migrations.py/ServerMigrationsSampleJsonTest.test_live_migrate_force_complete/original