5
5
# assert to_iso8601_extension(d, tz_jst) == "2019-10-08T16:20:08.241+09:00"
6
6
7
7
from annofabapi .models import TaskPhase
8
- from annofabapi .utils import (number_of_rejections , get_task_history_index_skipped_acceptance ,
8
+ from annofabapi .utils import (get_number_of_rejections , get_task_history_index_skipped_acceptance ,
9
9
get_task_history_index_skipped_inspection )
10
10
11
11
@@ -239,18 +239,18 @@ def test_get_task_history_index_skipped_inspection_検査2回_検査1回目で
239
239
expected = []
240
240
assert all ([a == b for a , b in zip (actual , expected )])
241
241
242
- def test_number_of_rejections_教師付1回目 (self ):
242
+ def test_get_number_of_rejections_教師付1回目 (self ):
243
243
task_history_short_list = [{
244
244
"account_id" : self .ACCOUNT_ID ,
245
245
"phase" : "annotation" ,
246
246
"phase_stage" : 1 ,
247
247
"worked" : True
248
248
}]
249
249
250
- actual = number_of_rejections (task_history_short_list , TaskPhase .ACCEPTANCE )
250
+ actual = get_number_of_rejections (task_history_short_list , TaskPhase .ACCEPTANCE )
251
251
assert actual == 0
252
252
253
- def test_number_of_rejections_受入で1回差戻 (self ):
253
+ def test_get_number_of_rejections_受入で1回差戻 (self ):
254
254
task_history_short_list = [
255
255
{
256
256
"account_id" : self .ACCOUNT_ID ,
@@ -272,10 +272,10 @@ def test_number_of_rejections_受入で1回差戻(self):
272
272
},
273
273
]
274
274
275
- actual = number_of_rejections (task_history_short_list , TaskPhase .ACCEPTANCE )
275
+ actual = get_number_of_rejections (task_history_short_list , TaskPhase .ACCEPTANCE )
276
276
assert actual == 1
277
277
278
- def test_number_of_rejections_検査で1回差戻 (self ):
278
+ def test_get_number_of_rejections_検査で1回差戻 (self ):
279
279
task_history_short_list = [
280
280
{
281
281
"account_id" : self .ACCOUNT_ID ,
@@ -297,5 +297,52 @@ def test_number_of_rejections_検査で1回差戻(self):
297
297
},
298
298
]
299
299
300
- actual = number_of_rejections (task_history_short_list , TaskPhase .INSPECTION )
300
+ actual = get_number_of_rejections (task_history_short_list , TaskPhase .INSPECTION )
301
301
assert actual == 1
302
+
303
+ def test_get_number_of_rejections_検査と受入で1回差戻 (self ):
304
+ task_history_short_list = [{
305
+ "account_id" : self .ACCOUNT_ID ,
306
+ "phase" : "annotation" ,
307
+ "phase_stage" : 1 ,
308
+ "worked" : True
309
+ }, {
310
+ "account_id" : self .ACCOUNT_ID ,
311
+ "phase" : "inspection" ,
312
+ "phase_stage" : 1 ,
313
+ "worked" : True
314
+ }, {
315
+ "account_id" : self .ACCOUNT_ID ,
316
+ "phase" : "annotation" ,
317
+ "phase_stage" : 1 ,
318
+ "worked" : True
319
+ }, {
320
+ "account_id" : self .ACCOUNT_ID ,
321
+ "phase" : "inspection" ,
322
+ "phase_stage" : 1 ,
323
+ "worked" : True
324
+ }, {
325
+ "account_id" : self .ACCOUNT_ID ,
326
+ "phase" : "acceptance" ,
327
+ "phase_stage" : 1 ,
328
+ "worked" : True
329
+ }, {
330
+ "account_id" : self .ACCOUNT_ID ,
331
+ "phase" : "annotation" ,
332
+ "phase_stage" : 1 ,
333
+ "worked" : True
334
+ }, {
335
+ "account_id" : "00589ed0-dd63-40db-abb2-dfe5e13c8299" ,
336
+ "phase" : "inspection" ,
337
+ "phase_stage" : 1 ,
338
+ "worked" : True
339
+ }, {
340
+ "account_id" : self .ACCOUNT_ID ,
341
+ "phase" : "acceptance" ,
342
+ "phase_stage" : 1 ,
343
+ "worked" : True
344
+ }]
345
+ actual_inspection = get_number_of_rejections (task_history_short_list , TaskPhase .INSPECTION )
346
+ assert actual_inspection == 1
347
+ actual_acceptance = get_number_of_rejections (task_history_short_list , TaskPhase .ACCEPTANCE )
348
+ assert actual_acceptance == 1
0 commit comments