@@ -44,16 +44,11 @@ class TestTap:
44
44
def test_show_message (self ):
45
45
connHandler = DummyConnHandler ()
46
46
47
- dummy_response = DummyResponse ()
48
- dummy_response .set_status_code (200 )
49
- dummy_response .set_message ("OK" )
47
+ dummy_response = DummyResponse (200 )
50
48
51
49
message_text = "1653401204784D[type: -100,-1]=Gaia dev is under maintenance"
52
50
53
- dummy_response .set_data (method = 'GET' ,
54
- context = None ,
55
- body = message_text ,
56
- headers = None )
51
+ dummy_response .set_data (method = 'GET' , body = message_text )
57
52
connHandler .set_default_response (dummy_response )
58
53
59
54
# show_server_messages
@@ -67,16 +62,11 @@ def test_query_object(self):
67
62
conn_handler = DummyConnHandler ()
68
63
# Launch response: we use default response because the query contains
69
64
# decimals
70
- dummy_response = DummyResponse ()
71
- dummy_response .set_status_code (200 )
72
- dummy_response .set_message ("OK" )
65
+ dummy_response = DummyResponse (200 )
73
66
74
67
message_text = "1653401204784D[type: -100,-1]=Gaia dev is under maintenance"
75
68
76
- dummy_response .set_data (method = 'GET' ,
77
- context = None ,
78
- body = message_text ,
79
- headers = None )
69
+ dummy_response .set_data (method = 'GET' , body = message_text )
80
70
conn_handler .set_default_response (dummy_response )
81
71
82
72
# show_server_messages
@@ -87,15 +77,10 @@ def test_query_object(self):
87
77
tap = GaiaClass (conn_handler , tapplus , show_server_messages = True )
88
78
# Launch response: we use default response because the query contains
89
79
# decimals
90
- response_launch_job = DummyResponse ()
91
- response_launch_job .set_status_code (200 )
92
- response_launch_job .set_message ("OK" )
80
+ response_launch_job = DummyResponse (200 )
93
81
job_data_file = data_path ('job_1.vot' )
94
82
job_data = utils .read_file_content (job_data_file )
95
- response_launch_job .set_data (method = 'POST' ,
96
- context = None ,
97
- body = job_data ,
98
- headers = None )
83
+ response_launch_job .set_data (method = 'POST' , body = job_data )
99
84
# The query contains decimals: force default response
100
85
conn_handler .set_default_response (response_launch_job )
101
86
sc = SkyCoord (ra = 29.0 , dec = 15.0 , unit = (u .degree , u .degree ),
@@ -168,38 +153,23 @@ def test_query_object_async(self):
168
153
tap = GaiaClass (conn_handler , tapplus , show_server_messages = False )
169
154
jobid = '12345'
170
155
# Launch response
171
- response_launch_job = DummyResponse ()
172
- response_launch_job .set_status_code (303 )
173
- response_launch_job .set_message ("OK" )
156
+ response_launch_job = DummyResponse (303 )
174
157
# list of list (httplib implementation for headers in response)
175
158
launch_response_headers = [
176
159
['location' , 'http://test:1111/tap/async/' + jobid ]
177
160
]
178
- response_launch_job .set_data (method = 'POST' ,
179
- context = None ,
180
- body = None ,
181
- headers = launch_response_headers )
161
+ response_launch_job .set_data (method = 'POST' , headers = launch_response_headers )
182
162
conn_handler .set_default_response (response_launch_job )
183
163
# Phase response
184
- response_phase = DummyResponse ()
185
- response_phase .set_status_code (200 )
186
- response_phase .set_message ("OK" )
187
- response_phase .set_data (method = 'GET' ,
188
- context = None ,
189
- body = "COMPLETED" ,
190
- headers = None )
164
+ response_phase = DummyResponse (200 )
165
+ response_phase .set_data (method = 'GET' , body = "COMPLETED" )
191
166
req = "async/" + jobid + "/phase"
192
167
conn_handler .set_response (req , response_phase )
193
168
# Results response
194
- response_results_job = DummyResponse ()
195
- response_results_job .set_status_code (200 )
196
- response_results_job .set_message ("OK" )
169
+ response_results_job = DummyResponse (200 )
197
170
job_data_file = data_path ('job_1.vot' )
198
171
job_data = utils .read_file_content (job_data_file )
199
- response_results_job .set_data (method = 'GET' ,
200
- context = None ,
201
- body = job_data ,
202
- headers = None )
172
+ response_results_job .set_data (method = 'GET' , body = job_data )
203
173
req = "async/" + jobid + "/results/result"
204
174
conn_handler .set_response (req , response_results_job )
205
175
sc = SkyCoord (ra = 29.0 , dec = 15.0 , unit = (u .degree , u .degree ),
@@ -263,15 +233,10 @@ def test_cone_search_sync(self):
263
233
tap = GaiaClass (conn_handler , tapplus , show_server_messages = False )
264
234
# Launch response: we use default response because the query contains
265
235
# decimals
266
- response_launch_job = DummyResponse ()
267
- response_launch_job .set_status_code (200 )
268
- response_launch_job .set_message ("OK" )
236
+ response_launch_job = DummyResponse (200 )
269
237
job_data_file = data_path ('job_1.vot' )
270
238
job_data = utils .read_file_content (job_data_file )
271
- response_launch_job .set_data (method = 'POST' ,
272
- context = None ,
273
- body = job_data ,
274
- headers = None )
239
+ response_launch_job .set_data (method = 'POST' , body = job_data )
275
240
ra = 19.0
276
241
dec = 20.0
277
242
sc = SkyCoord (ra = ra , dec = dec , unit = (u .degree , u .degree ), frame = 'icrs' )
@@ -316,42 +281,27 @@ def test_cone_search_async(self):
316
281
tap = GaiaClass (conn_handler , tapplus , show_server_messages = False )
317
282
jobid = '12345'
318
283
# Launch response
319
- response_launch_job = DummyResponse ()
320
- response_launch_job .set_status_code (303 )
321
- response_launch_job .set_message ("OK" )
284
+ response_launch_job = DummyResponse (303 )
322
285
# list of list (httplib implementation for headers in response)
323
286
launch_response_headers = [
324
287
['location' , 'http://test:1111/tap/async/' + jobid ]
325
288
]
326
- response_launch_job .set_data (method = 'POST' ,
327
- context = None ,
328
- body = None ,
329
- headers = launch_response_headers )
289
+ response_launch_job .set_data (method = 'POST' , headers = launch_response_headers )
330
290
ra = 19
331
291
dec = 20
332
292
sc = SkyCoord (ra = ra , dec = dec , unit = (u .degree , u .degree ), frame = 'icrs' )
333
293
radius = Quantity (1.0 , u .deg )
334
294
conn_handler .set_default_response (response_launch_job )
335
295
# Phase response
336
- response_phase = DummyResponse ()
337
- response_phase .set_status_code (200 )
338
- response_phase .set_message ("OK" )
339
- response_phase .set_data (method = 'GET' ,
340
- context = None ,
341
- body = "COMPLETED" ,
342
- headers = None )
296
+ response_phase = DummyResponse (200 )
297
+ response_phase .set_data (method = 'GET' , body = "COMPLETED" )
343
298
req = "async/" + jobid + "/phase"
344
299
conn_handler .set_response (req , response_phase )
345
300
# Results response
346
- response_results_job = DummyResponse ()
347
- response_results_job .set_status_code (200 )
348
- response_results_job .set_message ("OK" )
301
+ response_results_job = DummyResponse (200 )
349
302
job_data_file = data_path ('job_1.vot' )
350
303
job_data = utils .read_file_content (job_data_file )
351
- response_results_job .set_data (method = 'GET' ,
352
- context = None ,
353
- body = job_data ,
354
- headers = None )
304
+ response_results_job .set_data (method = 'GET' , body = job_data )
355
305
req = "async/" + jobid + "/results/result"
356
306
conn_handler .set_response (req , response_results_job )
357
307
job = tap .cone_search_async (sc , radius )
@@ -474,38 +424,23 @@ def test_xmatch(self):
474
424
tap = GaiaClass (conn_handler , tapplus , show_server_messages = False )
475
425
jobid = '12345'
476
426
# Launch response
477
- response_launch_job = DummyResponse ()
478
- response_launch_job .set_status_code (303 )
479
- response_launch_job .set_message ("OK" )
427
+ response_launch_job = DummyResponse (303 )
480
428
# list of list (httplib implementation for headers in response)
481
429
launch_response_headers = [
482
430
['location' , 'http://test:1111/tap/async/' + jobid ]
483
431
]
484
- response_launch_job .set_data (method = 'POST' ,
485
- context = None ,
486
- body = None ,
487
- headers = launch_response_headers )
432
+ response_launch_job .set_data (method = 'POST' , headers = launch_response_headers )
488
433
conn_handler .set_default_response (response_launch_job )
489
434
# Phase response
490
- response_phase = DummyResponse ()
491
- response_phase .set_status_code (200 )
492
- response_phase .set_message ("OK" )
493
- response_phase .set_data (method = 'GET' ,
494
- context = None ,
495
- body = "COMPLETED" ,
496
- headers = None )
435
+ response_phase = DummyResponse (200 )
436
+ response_phase .set_data (method = 'GET' , body = "COMPLETED" )
497
437
req = "async/" + jobid + "/phase"
498
438
conn_handler .set_response (req , response_phase )
499
439
# Results response
500
- response_results_job = DummyResponse ()
501
- response_results_job .set_status_code (200 )
502
- response_results_job .set_message ("OK" )
440
+ response_results_job = DummyResponse (200 )
503
441
job_data_file = data_path ('job_1.vot' )
504
442
job_data = utils .read_file_content (job_data_file )
505
- response_results_job .set_data (method = 'GET' ,
506
- context = None ,
507
- body = job_data ,
508
- headers = None )
443
+ response_results_job .set_data (method = 'GET' , body = job_data )
509
444
req = "async/" + jobid + "/results/result"
510
445
conn_handler .set_response (req , response_results_job )
511
446
query = ("SELECT crossmatch_positional(" ,
0 commit comments