@@ -460,17 +460,25 @@ def test_get_batches_success(self):
460
460
mock_response = {
461
461
"batches" : [
462
462
{
463
- "id" : "batch-1" ,
464
- "name" : "Batch 1" ,
465
- "created" : 1616161616 ,
466
- "images" : 10 ,
463
+ "name" : "Uploaded on 11/22/22 at 1:39 pm" ,
464
+ "numJobs" : 2 ,
465
+ "images" : 115 ,
466
+ "uploaded" : {
467
+ "_seconds" : 1669146024 ,
468
+ "_nanoseconds" : 818000000
469
+ },
470
+ "id" : "batch-1"
467
471
},
468
472
{
469
- "id" : "batch-2" ,
470
- "name" : "Batch 2" ,
471
- "created" : 1616161617 ,
472
- "images" : 5 ,
473
- },
473
+ "numJobs" : 0 ,
474
+ "images" : 11 ,
475
+ "uploaded" : {
476
+ "_seconds" : 1669236873 ,
477
+ "_nanoseconds" : 47000000
478
+ },
479
+ "name" : "Upload via API" ,
480
+ "id" : "batch-2"
481
+ }
474
482
]
475
483
}
476
484
@@ -482,7 +490,11 @@ def test_get_batches_success(self):
482
490
self .assertIn ("batches" , batches )
483
491
self .assertEqual (len (batches ["batches" ]), 2 )
484
492
self .assertEqual (batches ["batches" ][0 ]["id" ], "batch-1" )
493
+ self .assertEqual (batches ["batches" ][0 ]["name" ], "Uploaded on 11/22/22 at 1:39 pm" )
494
+ self .assertEqual (batches ["batches" ][0 ]["images" ], 115 )
495
+ self .assertEqual (batches ["batches" ][0 ]["numJobs" ], 2 )
485
496
self .assertEqual (batches ["batches" ][1 ]["id" ], "batch-2" )
497
+ self .assertEqual (batches ["batches" ][1 ]["name" ], "Upload via API" )
486
498
487
499
def test_get_batches_error (self ):
488
500
expected_url = f"{ API_URL } /{ WORKSPACE_NAME } /{ PROJECT_NAME } /batches?api_key={ ROBOFLOW_API_KEY } "
@@ -500,11 +512,14 @@ def test_get_batch_success(self):
500
512
expected_url = f"{ API_URL } /{ WORKSPACE_NAME } /{ PROJECT_NAME } /batches/{ batch_id } ?api_key={ ROBOFLOW_API_KEY } "
501
513
mock_response = {
502
514
"batch" : {
503
- "id" : batch_id ,
504
- "name" : "My Test Batch" ,
505
- "created" : 1616161616 ,
506
- "images" : 25 ,
507
- "metadata" : {"source" : "API Upload" , "type" : "test" },
515
+ "name" : "Uploaded on 11/22/22 at 1:39 pm" ,
516
+ "numJobs" : 2 ,
517
+ "images" : 115 ,
518
+ "uploaded" : {
519
+ "_seconds" : 1669146024 ,
520
+ "_nanoseconds" : 818000000
521
+ },
522
+ "id" : batch_id
508
523
}
509
524
}
510
525
@@ -515,9 +530,10 @@ def test_get_batch_success(self):
515
530
self .assertIsInstance (batch , dict )
516
531
self .assertIn ("batch" , batch )
517
532
self .assertEqual (batch ["batch" ]["id" ], batch_id )
518
- self .assertEqual (batch ["batch" ]["name" ], "My Test Batch" )
519
- self .assertEqual (batch ["batch" ]["images" ], 25 )
520
- self .assertIn ("metadata" , batch ["batch" ])
533
+ self .assertEqual (batch ["batch" ]["name" ], "Uploaded on 11/22/22 at 1:39 pm" )
534
+ self .assertEqual (batch ["batch" ]["images" ], 115 )
535
+ self .assertEqual (batch ["batch" ]["numJobs" ], 2 )
536
+ self .assertIn ("uploaded" , batch ["batch" ])
521
537
522
538
def test_get_batch_error (self ):
523
539
batch_id = "nonexistent-batch"
0 commit comments