@@ -252,84 +252,3 @@ def test_http_errors(
252252 assert "Could not resolve host" in error or "Resolving timed out after" in error
253253
254254 pg_conn .rollback ()
255-
256-
257- @pytest .fixture (scope = "module" )
258- def create_http_helper_functions (superuser_conn , iceberg_extension ):
259- run_command (
260- f"""
261- CREATE TYPE lake_iceberg.http_result AS (
262- status int,
263- body text,
264- resp_headers text
265- );
266-
267- CREATE OR REPLACE FUNCTION lake_iceberg.test_http_get(
268- url text,
269- headers text[] DEFAULT NULL)
270- RETURNS lake_iceberg.http_result
271- AS 'pg_lake_iceberg', 'test_http_get'
272- LANGUAGE C;
273-
274-
275- -- HEAD
276- CREATE OR REPLACE FUNCTION lake_iceberg.test_http_head(
277- url text,
278- headers text[] DEFAULT NULL)
279- RETURNS lake_iceberg.http_result
280- AS 'pg_lake_iceberg', 'test_http_head'
281- LANGUAGE C;
282-
283- -- POST
284- CREATE OR REPLACE FUNCTION lake_iceberg.test_http_post(
285- url text,
286- body text,
287- headers text[] DEFAULT NULL)
288- RETURNS lake_iceberg.http_result
289- AS 'pg_lake_iceberg', 'test_http_post'
290- LANGUAGE C;
291-
292- -- PUT
293- CREATE OR REPLACE FUNCTION lake_iceberg.test_http_put(
294- url text,
295- body text,
296- headers text[] DEFAULT NULL)
297- RETURNS lake_iceberg.http_result
298- AS 'pg_lake_iceberg', 'test_http_put'
299- LANGUAGE C;
300-
301- -- DELETE
302- CREATE OR REPLACE FUNCTION lake_iceberg.test_http_delete(
303- url text,
304- headers text[] DEFAULT NULL)
305- RETURNS lake_iceberg.http_result
306- AS 'pg_lake_iceberg', 'test_http_delete'
307- LANGUAGE C;
308-
309- -- URL encode function
310- CREATE OR REPLACE FUNCTION lake_iceberg.url_encode(input TEXT)
311- RETURNS text
312- LANGUAGE C
313- IMMUTABLE STRICT
314- AS 'pg_lake_iceberg', $function$url_encode_path$function$;
315-
316- """ ,
317- superuser_conn ,
318- )
319- superuser_conn .commit ()
320-
321- yield
322-
323- run_command (
324- """
325- DROP FUNCTION IF EXISTS lake_iceberg.url_encode;
326- DROP FUNCTION IF EXISTS lake_iceberg.test_http_get;
327- DROP FUNCTION IF EXISTS lake_iceberg.test_http_head;
328- DROP FUNCTION IF EXISTS lake_iceberg.test_http_post;
329- DROP FUNCTION IF EXISTS lake_iceberg.test_http_put;
330- DROP FUNCTION IF EXISTS lake_iceberg.test_http_delete;
331- DROP TYPE lake_iceberg.http_result;
332- """ ,
333- superuser_conn ,
334- )
335- superuser_conn .commit ()
0 commit comments