@@ -45,7 +45,8 @@ def test_list_tasks(self):
45
45
'task_args' : "((1, 'ftp://test/dataset_1_S3A_OL_1_EFR____20181213T024322_20181213T024622_20181214T065355_0179_039_089_2340_LN1_O_NT_002.zip'),)" ,
46
46
'date_created' : '2020-07-16T13:58:22.918000Z' ,
47
47
'date_done' : '2020-07-16T13:58:21.201000Z' ,
48
- 'meta' : "{\" children\" : []}"
48
+ 'meta' : "{\" children\" : []}" ,
49
+ 'periodic_task_name' : None ,
49
50
}, {
50
51
'id' : 3 ,
51
52
'content_encoding' : 'utf-8' ,
@@ -60,7 +61,8 @@ def test_list_tasks(self):
60
61
'task_args' : "((1, 'ftp://test/dataset_1_S3A_OL_1_EFR____20181213T024322_20181213T024622_20181214T065355_0179_039_089_2340_LN1_O_NT_002.zip'),)" ,
61
62
'date_created' : '2020-07-16T13:57:21.918000Z' ,
62
63
'date_done' : '2020-07-16T13:57:21.918000Z' ,
63
- 'meta' : "{\" children\" : []}"
64
+ 'meta' : "{\" children\" : []}" ,
65
+ 'periodic_task_name' : None ,
64
66
}, {
65
67
'id' : 2 ,
66
68
'content_encoding' : 'utf-8' ,
@@ -75,7 +77,8 @@ def test_list_tasks(self):
75
77
'task_args' : '(1,)' ,
76
78
'date_created' : '2020-07-16T13:53:33.864000Z' ,
77
79
'date_done' : '2020-07-16T13:57:21.912000Z' ,
78
- 'meta' : "{\" children\" : [[[\" 733d3a63-7a5a-4a1e-8cf0-750ae393dd98\" , null], null]]}"
80
+ 'meta' : "{\" children\" : [[[\" 733d3a63-7a5a-4a1e-8cf0-750ae393dd98\" , null], null]]}" ,
81
+ 'periodic_task_name' : None ,
79
82
}, {
80
83
'id' : 1 ,
81
84
'content_encoding' : 'utf-8' ,
@@ -90,7 +93,8 @@ def test_list_tasks(self):
90
93
'task_args' : '(1,)' ,
91
94
'date_created' : '2020-07-16T13:52:33.864000Z' ,
92
95
'date_done' : '2020-07-16T13:52:33.864000Z' ,
93
- 'meta' : "{\" children\" : []}"
96
+ 'meta' : "{\" children\" : []}" ,
97
+ 'periodic_task_name' : None ,
94
98
}
95
99
]
96
100
}
@@ -113,7 +117,8 @@ def test_retrieve_task(self):
113
117
"date_created" : "2020-07-16T13:52:33.864000Z" ,
114
118
"date_done" : "2020-07-16T13:52:33.864000Z" ,
115
119
"traceback" : None ,
116
- "meta" : "{\" children\" : []}"
120
+ "meta" : "{\" children\" : []}" ,
121
+ "periodic_task_name" : None ,
117
122
})
118
123
119
124
@@ -192,9 +197,11 @@ def test_get_signature_no_cropping(self):
192
197
mock_chain .assert_has_calls ([
193
198
mock .call ([
194
199
mock_tasks .download .signature .return_value ,
200
+ mock_tasks .copy .signature .return_value ,
195
201
]),
196
202
mock .call ([
197
203
mock_tasks .download .signature .return_value ,
204
+ mock_tasks .copy .signature .return_value ,
198
205
mock_tasks .archive .signature .return_value ,
199
206
mock_tasks .publish .signature .return_value ,
200
207
]),
@@ -210,11 +217,13 @@ def test_get_signature_cropping(self):
210
217
mock_chain .assert_has_calls ([
211
218
mock .call ([
212
219
mock_tasks .download .signature .return_value ,
220
+ mock_tasks .copy .signature .return_value ,
213
221
mock_tasks .unarchive .signature .return_value ,
214
222
mock_tasks .crop .signature .return_value ,
215
223
]),
216
224
mock .call ([
217
225
mock_tasks .download .signature .return_value ,
226
+ mock_tasks .copy .signature .return_value ,
218
227
mock_tasks .unarchive .signature .return_value ,
219
228
mock_tasks .crop .signature .return_value ,
220
229
mock_tasks .archive .signature .return_value ,
@@ -237,8 +246,10 @@ def test_check_parameters_wrong_key(self):
237
246
models .DownloadJob .check_parameters (parameters )
238
247
self .assertListEqual (
239
248
raised .exception .detail ,
240
- [ErrorDetail (string = "The download action accepts only one parameter: 'dataset_id'" ,
241
- code = 'invalid' )])
249
+ [ErrorDetail (
250
+ string = "The download action accepts only the following parameters:"
251
+ " ('dataset_id', 'bounding_box', 'publish', 'copy_to')" ,
252
+ code = 'invalid' )])
242
253
243
254
def test_check_parameters_extra_param (self ):
244
255
"""`check_parameters()` must raise an exception if an extra parameter is given"""
@@ -247,7 +258,8 @@ def test_check_parameters_extra_param(self):
247
258
models .DownloadJob .check_parameters (parameters )
248
259
self .assertListEqual (
249
260
raised .exception .detail ,
250
- [ErrorDetail (string = "The download action accepts only one parameter: 'dataset_id'" ,
261
+ [ErrorDetail (string = "The download action accepts only the following parameters:"
262
+ " ('dataset_id', 'bounding_box', 'publish', 'copy_to')" ,
251
263
code = 'invalid' )])
252
264
253
265
def test_check_parameters_wrong_id_type (self ):
@@ -296,7 +308,7 @@ def test_check_parameters_wrong_key(self):
296
308
raised .exception .detail ,
297
309
[ErrorDetail (string = "The convert action accepts only these parameters: "
298
310
"dataset_id, format, bounding_box, skip_check, converter_options, "
299
- "remove_downloaded, ttl" ,
311
+ "remove_downloaded, ttl, copy_to " ,
300
312
code = 'invalid' )])
301
313
302
314
def test_check_parameters_wrong_format (self ):
@@ -316,7 +328,7 @@ def test_check_parameters_extra_param(self):
316
328
raised .exception .detail ,
317
329
[ErrorDetail (string = "The convert action accepts only these parameters: "
318
330
"dataset_id, format, bounding_box, skip_check, converter_options, "
319
- "remove_downloaded, ttl" ,
331
+ "remove_downloaded, ttl, copy_to " ,
320
332
code = 'invalid' )])
321
333
322
334
def test_check_parameters_wrong_type_for_dataset_id (self ):
@@ -374,6 +386,7 @@ def test_get_signature_syntool(self):
374
386
"""Test the right signature is returned"""
375
387
base_chain = celery .chain (
376
388
tasks_core .download .signature (),
389
+ tasks_core .copy .signature (kwargs = {'copy_to' : None }),
377
390
tasks_core .unarchive .signature (),
378
391
tasks_core .crop .signature (
379
392
kwargs = {'bounding_box' : [0 , 20 , 20 , 0 ]}),
@@ -405,6 +418,7 @@ def test_get_signature_idf(self):
405
418
}),
406
419
celery .chain (
407
420
tasks_core .download .signature (),
421
+ tasks_core .copy .signature (kwargs = {'copy_to' : None }),
408
422
tasks_core .unarchive .signature (),
409
423
tasks_core .crop .signature (
410
424
kwargs = {'bounding_box' : [0 , 20 , 20 , 0 ]}),
0 commit comments