@@ -289,16 +289,20 @@ def test_tap_url():
289289 ("> 1.23" , "> 1.23" ),
290290 ("< '5'" , "< '5'" ),
291291 ("> '1.23'" , "> '1.23'" ),
292- ("like '%John%'" , "like '%John%'" ),
293- ("not like '%John%'" , "not like '%John%'" ),
294- ("in ('apple', 'mango', 'orange')" , "in ('apple', 'mango', 'orange')" ),
295- ("not in ('apple', 'mango', 'orange')" , "not in ('apple', 'mango', 'orange')" ),
296- ("in (1, 2, 3)" , "in (1, 2, 3)" ),
297- ("not in (1, 2, 3)" , "not in (1, 2, 3)" ),
292+
293+ ("like '%John%'" , "like '%John%'" ),
294+ ("not like '%John%'" , "not like '%John%'" ),
295+ ("in ('apple', 'mango', 'orange')" , "in ('apple', 'mango', 'orange')" ),
296+ ("not in ('apple', 'mango', 'orange')" , "not in ('apple', 'mango', 'orange')" ),
297+ ("in (1, 2, 3)" , "in (1, 2, 3)" ),
298+ ("not in (1, 2, 3)" , "not in (1, 2, 3)" ),
298299
299300 # Operator-based queries
300301 ("<5" , "< 5" ),
301302 (">1.23" , "> 1.23" ),
303+ (">=1.23" , ">= 1.23" ),
304+ ("<=1.23" , "<= 1.23" ),
305+ ("!=1.23" , "!= 1.23" ),
302306 ("<'5'" , "< '5'" ),
303307 (">'1.23'" , "> '1.23'" ),
304308
@@ -312,8 +316,8 @@ def test_tap_url():
312316 ("like'%John%'" , "= 'like'%John%''" ), # pathologic case
313317
314318 # Ill-formed queries: Operator, but not sanitized. Expected to be passed through as-is
315- ("like %John%" , "like %John%" ),
316- ("not like %John%" , "not like %John%" ),
319+ ("like %John%" , "like %John%" ),
320+ ("not like %John%" , "not like %John%" ),
317321 ("= SGR A" , "= SGR A" ),
318322])
319323def test_adql_sanitize_op_val (input_val , expected ):
@@ -474,7 +478,7 @@ def test_reorder_columns(monkeypatch):
474478 columns = ["id" , "instrument" ],
475479 column_filters = {"instrument" : "in ('MUSE', 'UVES')" , "t_exptime" : "> 100" },
476480 order_by = "t_exptime" ),
477- "select id, instrument from beautiful.Stars where instrument in ('MUSE', 'UVES') "
481+ "select id, instrument from beautiful.Stars where instrument in ('MUSE', 'UVES') "
478482 "and t_exptime > 100 order by t_exptime desc" ),
479483
480484 # With all params 1
@@ -497,7 +501,7 @@ def test_reorder_columns(monkeypatch):
497501 query_str_only = True ,
498502 ),
499503 "select top 100 target_name, s_ra, s_dec, em_min, em_max from ivoa.ObsCore "
500- "where em_min > 4e-7 and em_max < 1.2e-6 and dataproduct_type in ('spectrum') "
504+ "where em_min > 4e-7 and em_max < 1.2e-6 and dataproduct_type in ('spectrum') "
501505 "and intersects(s_region, circle('ICRS', 180.0, -45.0, 0.05))=1 "
502506 "order by em_min desc"
503507 ),
@@ -522,7 +526,7 @@ def test_reorder_columns(monkeypatch):
522526 query_str_only = True ,
523527 ),
524528 "select top 100 count(*) from ivoa.ObsCore "
525- "where em_min > 4e-7 and em_max < 1.2e-6 and dataproduct_type in ('spectrum') "
529+ "where em_min > 4e-7 and em_max < 1.2e-6 and dataproduct_type in ('spectrum') "
526530 "and intersects(s_region, circle('ICRS', 180.0, -45.0, 0.05))=1"
527531 ),
528532])
0 commit comments