@@ -289,16 +289,20 @@ def test_tap_url():
289
289
("> 1.23" , "> 1.23" ),
290
290
("< '5'" , "< '5'" ),
291
291
("> '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)" ),
298
299
299
300
# Operator-based queries
300
301
("<5" , "< 5" ),
301
302
(">1.23" , "> 1.23" ),
303
+ (">=1.23" , ">= 1.23" ),
304
+ ("<=1.23" , "<= 1.23" ),
305
+ ("!=1.23" , "!= 1.23" ),
302
306
("<'5'" , "< '5'" ),
303
307
(">'1.23'" , "> '1.23'" ),
304
308
@@ -312,8 +316,8 @@ def test_tap_url():
312
316
("like'%John%'" , "= 'like'%John%''" ), # pathologic case
313
317
314
318
# 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%" ),
317
321
("= SGR A" , "= SGR A" ),
318
322
])
319
323
def test_adql_sanitize_op_val (input_val , expected ):
@@ -474,7 +478,7 @@ def test_reorder_columns(monkeypatch):
474
478
columns = ["id" , "instrument" ],
475
479
column_filters = {"instrument" : "in ('MUSE', 'UVES')" , "t_exptime" : "> 100" },
476
480
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') "
478
482
"and t_exptime > 100 order by t_exptime desc" ),
479
483
480
484
# With all params 1
@@ -497,7 +501,7 @@ def test_reorder_columns(monkeypatch):
497
501
query_str_only = True ,
498
502
),
499
503
"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') "
501
505
"and intersects(s_region, circle('ICRS', 180.0, -45.0, 0.05))=1 "
502
506
"order by em_min desc"
503
507
),
@@ -522,7 +526,7 @@ def test_reorder_columns(monkeypatch):
522
526
query_str_only = True ,
523
527
),
524
528
"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') "
526
530
"and intersects(s_region, circle('ICRS', 180.0, -45.0, 0.05))=1"
527
531
),
528
532
])
0 commit comments