@@ -29,8 +29,7 @@ def test_programs_list(self):
29
29
user = models .User .objects .get (username = "test_user" )
30
30
self .client .force_authenticate (user = user )
31
31
32
- programs_response = self .client .get (
33
- reverse ("v1:programs-list" ), format = "json" )
32
+ programs_response = self .client .get (reverse ("v1:programs-list" ), format = "json" )
34
33
35
34
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
36
35
self .assertEqual (len (programs_response .data ), 3 )
@@ -45,8 +44,7 @@ def test_provider_programs_list(self):
45
44
user = models .User .objects .get (username = "test_user_2" )
46
45
self .client .force_authenticate (user = user )
47
46
48
- programs_response = self .client .get (
49
- reverse ("v1:programs-list" ), format = "json" )
47
+ programs_response = self .client .get (reverse ("v1:programs-list" ), format = "json" )
50
48
51
49
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
52
50
self .assertEqual (len (programs_response .data ), 1 )
@@ -162,8 +160,7 @@ def test_run_locked(self):
162
160
)
163
161
164
162
self .assertEqual (programs_response .status_code , status .HTTP_423_LOCKED )
165
- self .assertEqual (programs_response .data .get (
166
- "message" ), "Program is locked" )
163
+ self .assertEqual (programs_response .data .get ("message" ), "Program is locked" )
167
164
168
165
def test_run_locked_default_msg (self ):
169
166
"""Tests run disabled program."""
@@ -188,8 +185,9 @@ def test_run_locked_default_msg(self):
188
185
)
189
186
190
187
self .assertEqual (programs_response .status_code , status .HTTP_423_LOCKED )
191
- self .assertEqual (programs_response .data .get (
192
- "message" ), Program .DEFAULT_DISABLED_MESSAGE )
188
+ self .assertEqual (
189
+ programs_response .data .get ("message" ), Program .DEFAULT_DISABLED_MESSAGE
190
+ )
193
191
194
192
def test_upload_private_function (self ):
195
193
"""Tests upload end-point authorized."""
@@ -230,8 +228,7 @@ def test_upload_custom_image_without_provider(self):
230
228
"image" : "icr.io/awesome-namespace/awesome-title" ,
231
229
},
232
230
)
233
- self .assertEqual (programs_response .status_code ,
234
- status .HTTP_400_BAD_REQUEST )
231
+ self .assertEqual (programs_response .status_code , status .HTTP_400_BAD_REQUEST )
235
232
236
233
def test_upload_custom_image_without_access_to_the_provider (self ):
237
234
"""Tests upload end-point authorized."""
@@ -250,8 +247,7 @@ def test_upload_custom_image_without_access_to_the_provider(self):
250
247
"provider" : "ibm" ,
251
248
},
252
249
)
253
- self .assertEqual (programs_response .status_code ,
254
- status .HTTP_404_NOT_FOUND )
250
+ self .assertEqual (programs_response .status_code , status .HTTP_404_NOT_FOUND )
255
251
256
252
programs_response = self .client .post (
257
253
"/api/v1/programs/upload/" ,
@@ -262,8 +258,7 @@ def test_upload_custom_image_without_access_to_the_provider(self):
262
258
"image" : "docker.io/awesome-namespace/awesome-title" ,
263
259
},
264
260
)
265
- self .assertEqual (programs_response .status_code ,
266
- status .HTTP_404_NOT_FOUND )
261
+ self .assertEqual (programs_response .status_code , status .HTTP_404_NOT_FOUND )
267
262
268
263
def test_upload_provider_function (self ):
269
264
"""Tests upload end-point authorized."""
@@ -314,8 +309,7 @@ def test_upload_provider_function_with_title(self):
314
309
self .assertEqual (
315
310
programs_response .data .get ("entrypoint" ), "test_user_3_program.py"
316
311
)
317
- self .assertEqual (programs_response .data .get (
318
- "title" ), "Provider Function" )
312
+ self .assertEqual (programs_response .data .get ("title" ), "Provider Function" )
319
313
self .assertRaises (
320
314
Program .DoesNotExist ,
321
315
Program .objects .get ,
@@ -343,8 +337,7 @@ def test_upload_authorization_error(self):
343
337
"provider" : "default" ,
344
338
},
345
339
)
346
- self .assertEqual (programs_response .status_code ,
347
- status .HTTP_404_NOT_FOUND )
340
+ self .assertEqual (programs_response .status_code , status .HTTP_404_NOT_FOUND )
348
341
349
342
def test_upload_provider_function_with_description (self ):
350
343
"""Tests upload end-point authorized."""
@@ -372,8 +365,7 @@ def test_upload_provider_function_with_description(self):
372
365
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
373
366
self .assertEqual (programs_response .data .get ("provider" ), "default" )
374
367
375
- programs_response = self .client .get (
376
- reverse ("v1:programs-list" ), format = "json" )
368
+ programs_response = self .client .get (reverse ("v1:programs-list" ), format = "json" )
377
369
378
370
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
379
371
self .assertEqual (len (programs_response .data ), 2 )
@@ -408,8 +400,7 @@ def test_list_runtimejob(self):
408
400
"/api/v1/jobs/8317718f-5c0d-4fb6-9947-72e480b8a348/list_runtimejob/" ,
409
401
format = "json" ,
410
402
)
411
- self .assertEqual (programs_response .json (),
412
- '["runtime_job_1", "runtime_job_2"]' )
403
+ self .assertEqual (programs_response .json (), '["runtime_job_1", "runtime_job_2"]' )
413
404
414
405
programs_response = self .client .get (
415
406
"/api/v1/jobs/57fc2e4d-267f-40c6-91a3-38153272e764/list_runtimejob/" ,
@@ -442,8 +433,7 @@ def test_get_by_title(self):
442
433
{"provider" : "non-existing" },
443
434
format = "json" ,
444
435
)
445
- self .assertEqual (
446
- programs_response_non_existing_provider .status_code , 404 )
436
+ self .assertEqual (programs_response_non_existing_provider .status_code , 404 )
447
437
448
438
programs_response_do_not_have_access = self .client .get (
449
439
"/api/v1/programs/get_by_title/Program/" ,
@@ -505,8 +495,7 @@ def test_upload_private_function_update_without_description(self):
505
495
506
496
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
507
497
self .assertEqual (
508
- programs_response .data .get (
509
- "description" ), "Program description test"
498
+ programs_response .data .get ("description" ), "Program description test"
510
499
)
511
500
512
501
def test_upload_private_function_update_description (self ):
@@ -530,5 +519,4 @@ def test_upload_private_function_update_description(self):
530
519
)
531
520
532
521
self .assertEqual (programs_response .status_code , status .HTTP_200_OK )
533
- self .assertEqual (programs_response .data .get (
534
- "description" ), description )
522
+ self .assertEqual (programs_response .data .get ("description" ), description )
0 commit comments