'Test exception path for create_export failure.'

@mock.patch.object(fake_driver.FakeLoggingVolumeDriver, 'create_export')
def test_initialize_connection_export_failure(self, _mock_create_export):

    volume = tests_utils.create_volume(self.context, admin_metadata={'fake-key': 'fake-value'}, volume_type_id=fake.VOLUME_TYPE_ID, **self.volume_params)
    _mock_create_export.side_effect = exception.CinderException
    connector = {'ip': 'IP', 'initiator': 'INITIATOR'}
    self.assertRaises(exception.VolumeBackendAPIException, self.volume.initialize_connection, self.context, volume, connector)
