@@ -120,19 +120,17 @@ def _step_attempt_delete_missing_ovn(self):
120120 # We don't expect to reach this point:
121121 check .record_failed (
122122 summary = "OIR Deletion with empty OVN was not expected to succeed" ,
123- details = f"Was expecting an HTTP 400, 404 or 409 response because of an empty OVN, but got { q .status_code } instead " ,
123+ details = f"Was expecting an HTTP 400, 404 or 409 response because of an empty OVN, but got { q .status_code } " ,
124124 query_timestamps = [q .request .timestamp ],
125125 )
126126 except QueryError as qe :
127127 self .record_queries (qe .queries )
128- if qe .cause_status_code in [400 , 404 , 409 ]:
129- # An empty OVN can be seen as:
130- # an incorrect parameter (400), a reference to a non-existing entity (404) as well as a conflict (409)
131- pass
132- else :
128+ # An empty OVN can be seen as:
129+ # an incorrect parameter (400), a reference to a non-existing entity (404) as well as a conflict (409)
130+ if qe .cause_status_code not in [400 , 404 , 409 ]:
133131 check .record_failed (
134132 summary = "OIR Deletion with empty OVN failed for unexpected reason" ,
135- details = f"Was expecting an HTTP 400, 404 or 409 response because of an empty OVN, but got { qe .cause_status_code } instead " ,
133+ details = f"Was expecting an HTTP 400, 404 or 409 response because of an empty OVN, but got { qe .cause_status_code } : { qe . msg } " ,
136134 query_timestamps = qe .query_timestamps ,
137135 )
138136
@@ -152,18 +150,16 @@ def _step_attempt_delete_incorrect_ovn(self):
152150 # We don't expect to reach this point:
153151 check .record_failed (
154152 summary = "OIR Deletion with incorrect OVN was not expected to succeed" ,
155- details = f"Was expecting an HTTP 400, 404 or 409 response because of an incorrect OVN, but got { q .status_code } instead " ,
153+ details = f"Was expecting an HTTP 409 response because of an incorrect OVN, but got { q .status_code } " ,
156154 query_timestamps = [q .request .timestamp ],
157155 )
158156 except QueryError as qe :
159157 self .record_queries (qe .queries )
160- if qe .cause_status_code in [400 , 404 , 409 ]:
161- # The spec explicitly requests a 409 response code for incorrect OVNs.
162- pass
163- else :
158+ # The spec explicitly requests a 409 response code for incorrect OVNs.
159+ if qe .cause_status_code != 409 :
164160 check .record_failed (
165161 summary = "OIR Deletion with incorrect OVN failed for unexpected reason" ,
166- details = f"Was expecting an HTTP 400, 404 or 409 response because of an incorrect OVN, but got { qe .cause_status_code } instead " ,
162+ details = f"Was expecting an HTTP 409 response because of an incorrect OVN, but got { qe .cause_status_code } : { qe . msg } " ,
167163 query_timestamps = qe .query_timestamps ,
168164 )
169165
@@ -189,19 +185,17 @@ def _step_attempt_mutation_missing_ovn(self):
189185 # We don't expect to reach this point:
190186 check .record_failed (
191187 summary = "OIR Mutation with missing OVN was not expected to succeed" ,
192- details = f"Was expecting an HTTP 400, 404 or 409 response because of a missing OVN, but got { query .status_code } instead " ,
188+ details = f"Was expecting an HTTP 400, 404 or 409 response because of a missing OVN, but got { query .status_code } " ,
193189 query_timestamps = [query .request .timestamp ],
194190 )
195191 except QueryError as qe :
196192 self .record_queries (qe .queries )
197- if qe .cause_status_code in [400 , 404 , 409 ]:
198- # An empty OVN can be seen as:
199- # an incorrect parameter (400), a reference to a non-existing entity (404) as well as a conflict (409)
200- pass
201- else :
193+ # An empty OVN can be seen as:
194+ # an incorrect parameter (400), a reference to a non-existing entity (404) as well as a conflict (409)
195+ if qe .cause_status_code not in [400 , 404 , 409 ]:
202196 check .record_failed (
203197 summary = "OIR Mutation with missing OVN failed for unexpected reason" ,
204- details = f"Was expecting an HTTP 400, 404 or 409 response because of a missing OVN, but got { qe .cause_status_code } instead " ,
198+ details = f"Was expecting an HTTP 400, 404 or 409 response because of a missing OVN, but got { qe .cause_status_code } : { qe . msg } " ,
205199 query_timestamps = qe .query_timestamps ,
206200 )
207201 self .end_test_step ()
@@ -226,17 +220,16 @@ def _step_attempt_mutation_incorrect_ovn(self):
226220 # We don't expect to reach this point:
227221 check .record_failed (
228222 summary = "OIR Mutation with incorrect OVN was not expected to succeed" ,
229- details = f"Was expecting an HTTP 400, 404 or 409 response because of an incorrect OVN, but got { query .status_code } instead " ,
223+ details = f"Was expecting an HTTP 409 response because of an incorrect OVN, but got { query .status_code } " ,
230224 query_timestamps = [query .request .timestamp ],
231225 )
232226 except QueryError as qe :
233227 self .record_queries (qe .queries )
234- if qe .cause_status_code in [400 , 404 , 409 ]:
235- pass
236- else :
228+ # The spec explicitly requests a 409 response code for incorrect OVNs.
229+ if qe .cause_status_code != 409 :
237230 check .record_failed (
238231 summary = "OIR Mutation with incorrect OVN failed for unexpected reason" ,
239- details = f"Was expecting an HTTP 400, 404 or 409 response because of an incorrect OVN, but got { qe .cause_status_code } instead " ,
232+ details = f"Was expecting an HTTP 409 response because of an incorrect OVN, but got { qe .cause_status_code } : { qe . msg } " ,
240233 query_timestamps = qe .query_timestamps ,
241234 )
242235
0 commit comments