2 File in charge of testing the http response codes.
6from fastapi
import Response
8sys.path.append(os.getcwd())
11except ImportError
as e:
12 raise ImportError(
"Failed to import the src module")
from e
17 Get the generated status from the boilerplate.
20 data (Response): _description_
25 return data.status_code
29 """ send_continue: 100 """
35 """ switching_protocols: 101 """
41 """ processing: 102 """
47 """ early_hints: 103 """
53 """ response_is_stale: 110 """
77 """ non_authoritative_information: 203 """
78 status =
_get_status(HCI.non_authoritative_information())
83 """ no_content: 204 """
89 """ reset_content: 205 """
95 """ partial_content: 206 """
101 """ multi_status: 207 """
107 """ already_reported: 208 """
119 """ multiple_choices: 300 """
125 """ moved_permanently: 301 """
137 """ see_other: 303 """
143 """ not_modified: 304 """
149 """ use_proxy: 305 """
155 """ switch_proxy: 306 """
161 """ temporary_redirect: 307 """
167 """ permanent_redirect: 308 """
173 """ bad_request: 400 """
179 """ unauthorized: 401 """
185 """ payment_required: 402 """
191 """ forbidden: 403 """
197 """ not_found: 404 """
203 """ method_not_allowed: 405 """
209 """ not_acceptable: 406 """
215 """ proxy_authentication_required: 407 """
216 status =
_get_status(HCI.proxy_authentication_required())
221 """ request_timeout: 408 """
227 """ conflict: 409 """
239 """ length_required: 411 """
245 """ precondition_failed: 412 """
251 """ payload_too_large: 413 """
257 """ uri_too_long: 414 """
263 """ unsupported_media_type: 415 """
269 """ range_not_satisfiable: 416 """
275 """ expectation_failed: 417 """
281 """ im_a_teapot: 418 """
287 """ page_expired: 419 """
293 """ enhance_your_calm: 420 """
299 """ misdirected_request: 421 """
305 """ unprocessable_entity: 422 """
317 """ failed_dependency: 424 """
323 """ too_early: 425 """
329 """ upgrade_required: 426 """
335 """ precondition_required: 428 """
341 """ too_many_requests: 429 """
347 """ request_header_fields_too_large: 431 """
348 status =
_get_status(HCI.request_header_fields_too_large())
353 """ unavailable_for_legal_reasons: 451 """
354 status =
_get_status(HCI.unavailable_for_legal_reasons())
359 """ invalid_token: 498 """
365 """ internal_server_error: 500 """
371 """ not_implemented: 501 """
377 """ bad_gateway: 502 """
383 """ service_unavailable: 503 """
389 """ gateway_timeout: 504 """
395 """ http_version_not_supported: 505 """
396 status =
_get_status(HCI.http_version_not_supported())
401 """ variant_also_negotiates: 506 """
402 status =
_get_status(HCI.variant_also_negotiates())
407 """ insufficient_storage: 507 """
413 """ loop_detected: 508 """
419 """ bandwidth_limit_exceeded: 509 """
420 status =
_get_status(HCI.bandwidth_limit_exceeded())
425 """ not_extended: 510 """
431 """ network_authentication_required: 511 """
432 status =
_get_status(HCI.network_authentication_required())
None test_length_required()
None test_method_not_allowed()
None test_internal_server_error()
None test_multiple_choices()
None test_gateway_timeout()
None test_misdirected_request()
None test_invalid_token()
None test_insufficient_storage()
None test_proxy_authentication_required()
None test_unavailable_for_legal_reasons()
None test_request_timeout()
None test_precondition_required()
int _get_status(Response data)
None test_service_unavailable()
None test_enhance_your_calm()
None test_partial_content()
None test_request_header_fields_too_large()
None test_unprocessable_entity()
None test_permanent_redirect()
None test_payload_too_large()
None test_already_reported()
None test_http_version_not_supported()
None test_too_many_requests()
None test_reset_content()
None test_network_authentication_required()
None test_range_not_satisfiable()
None test_upgrade_required()
None test_payment_required()
None test_failed_dependency()
None test_send_continue()
None test_not_implemented()
None test_expectation_failed()
None test_precondition_failed()
None test_non_authoritative_information()
None test_response_is_stale()
None test_not_acceptable()
None test_bandwidth_limit_exceeded()
None test_switching_protocols()
None test_variant_also_negotiates()
None test_moved_permanently()
None test_loop_detected()
None test_temporary_redirect()
None test_unsupported_media_type()