@@ -16,7 +16,7 @@ def _assert_204(response):
16
16
17
17
def test_validate_prediction (client : TestClient , example ) -> None :
18
18
response = client .post (
19
- "/validate-prediction-request" , json = example .good_prediction .dict ()
19
+ "/validate-prediction-request" , json = example .good_prediction .model_dump ()
20
20
)
21
21
_assert_204 (response )
22
22
@@ -27,7 +27,7 @@ def test_validate_prediction_not_valid(client: TestClient, example) -> None:
27
27
28
28
def test_validate_outcome (client : TestClient , example ) -> None :
29
29
response = client .post (
30
- "/validate-outcome-request" , json = example .good_prediction .dict ()
30
+ "/validate-outcome-request" , json = example .good_prediction .model_dump ()
31
31
)
32
32
_assert_204 (response )
33
33
@@ -37,7 +37,7 @@ def test_validate_outcome_not_valid(client: TestClient, example) -> None:
37
37
38
38
39
39
def test_compute_rewards (client : TestClient , example ) -> None :
40
- response = client .post ("/compute-reward" , json = example .good_prediction .dict ())
40
+ response = client .post ("/compute-reward" , json = example .good_prediction .model_dump ())
41
41
assert response .status_code == 200
42
42
# Raise an exception if not if the model does not validate the payload
43
43
compute_reward_response = ComputeRewardResponse .parse_obj (response .json ())
@@ -63,13 +63,13 @@ def _failed_validation(client, path, example):
63
63
assert response .status_code == 422
64
64
65
65
# Extra field
66
- data = example .good_prediction .dict ()
66
+ data = example .good_prediction .model_dump ()
67
67
data ["c" ] = 2
68
68
response = client .post (path , json = data )
69
69
assert response .status_code == 422
70
70
71
71
# Wrong type
72
- data = example .good_prediction .dict ()
72
+ data = example .good_prediction .model_dump ()
73
73
data ["b" ] = "def"
74
74
response = client .post (path , json = data )
75
75
assert response .status_code == 422
0 commit comments