20
20
{'strategy' : 'BEST_N_PAGES' , 'parameters' : {'n' : 3 , 'collapse' : False }},
21
21
None ,
22
22
])
23
- def test_create_prediction (client : Client , preprocess_config , postprocess_config ):
23
+ @pytest .mark .parametrize ('sync' , [True , False , None ])
24
+ def test_create_prediction (client : Client , preprocess_config , postprocess_config , sync ):
24
25
document_id = service .create_document_id ()
25
26
model_id = service .create_model_id ()
26
27
response = client .create_prediction (
27
28
document_id ,
28
29
model_id ,
29
30
preprocess_config = dictstrip (preprocess_config ) if preprocess_config else None ,
30
31
postprocess_config = postprocess_config ,
32
+ sync = sync ,
31
33
)
32
34
assert 'predictionId' in response , 'Missing predictionId in response'
33
35
@@ -39,3 +41,12 @@ def test_list_predictions(client: Client, sort_by, order, model_id):
39
41
response = client .list_predictions (sort_by = sort_by , order = order , model_id = model_id )
40
42
logging .info (response )
41
43
assert 'predictions' in response , 'Missing predictions in response'
44
+
45
+
46
+ @pytest .mark .parametrize ('prediction_id' , [service .create_prediction_id (), None ])
47
+ def test_get_prediction (client : Client , prediction_id ):
48
+ response = client .get_prediction (prediction_id )
49
+ logging .info (response )
50
+ assert 'predictionId' in response , 'Missing prediction in response'
51
+ assert 'inferenceTime' in response , 'Missing inferenceTime in response'
52
+ assert 'predictions' in response , 'Missing predictions in response'
0 commit comments