File tree 1 file changed +22
-0
lines changed
microsetta_private_api/admin/tests
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1281,6 +1281,28 @@ def test_query_barcode_stats_multiple_projects(self):
1281
1281
# content: should have exactly the same projects
1282
1282
self .assertEqual (response_projects [1 ], response_projects [2 ])
1283
1283
1284
+ def test_query_barcode_stats_by_project (self ):
1285
+ input_json = json .dumps ({'project_id' : 19 }) # expect 5 barcodes
1286
+ exp_barcodes = [
1287
+ '000035369' , '000035370' , '000035371' ,
1288
+ '000035372' , '000035373'
1289
+ ]
1290
+
1291
+ response = self .client .post (
1292
+ "api/admin/account_barcode_summary?strip_sampleid=False" ,
1293
+ content_type = 'application/json' ,
1294
+ data = input_json ,
1295
+ headers = MOCK_HEADERS
1296
+ )
1297
+ # an empty string project should be unknown
1298
+ self .assertEqual (200 , response .status_code )
1299
+
1300
+ response_obj = json .loads (response .data )
1301
+ self .assertIn ('samples' , response_obj )
1302
+ response_obj = response_obj ['samples' ]
1303
+ self .assertEqual (len (response_obj ), 5 )
1304
+ self .assertEqual ([v ['sampleid' ] for v in response_obj ], exp_barcodes )
1305
+
1284
1306
def test_send_email (self ):
1285
1307
def mock_func (* args , ** kwargs ):
1286
1308
pass
You can’t perform that action at this time.
0 commit comments