Skip to content

Commit f903cbb

Browse files
committed
add some tests
1 parent 34d3885 commit f903cbb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: tests/test_predictions.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
{'strategy': 'BEST_N_PAGES', 'parameters': {'n': 3, 'collapse': False}},
2121
None,
2222
])
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):
2425
document_id = service.create_document_id()
2526
model_id = service.create_model_id()
2627
response = client.create_prediction(
2728
document_id,
2829
model_id,
2930
preprocess_config=dictstrip(preprocess_config) if preprocess_config else None,
3031
postprocess_config=postprocess_config,
32+
sync=sync,
3133
)
3234
assert 'predictionId' in response, 'Missing predictionId in response'
3335

@@ -39,3 +41,12 @@ def test_list_predictions(client: Client, sort_by, order, model_id):
3941
response = client.list_predictions(sort_by=sort_by, order=order, model_id=model_id)
4042
logging.info(response)
4143
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

Comments
 (0)