diff options
| author | 2021-06-03 04:02:41 +0300 | |
|---|---|---|
| committer | 2021-06-03 04:02:41 +0300 | |
| commit | 11f5f02d7f5ba7c9d1e4458e155ca9ce17d49024 (patch) | |
| tree | 01a9c7570cfa1309d964fb3f6d026f6d95be92ea /backend/routes | |
| parent | Handles Code Questions With No Tests (diff) | |
Verifies Unittest Error Responses
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to '')
| -rw-r--r-- | backend/routes/forms/submit.py | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/backend/routes/forms/submit.py b/backend/routes/forms/submit.py index a6c3fbd..7229ee1 100644 --- a/backend/routes/forms/submit.py +++ b/backend/routes/forms/submit.py @@ -45,6 +45,18 @@ class PartialSubmission(BaseModel):      captcha: Optional[str] +class UnittestError(BaseModel): +    question_id: str +    question_index: int +    return_code: int +    passed: bool +    result: str + + +class UnittestErrorMessage(ErrorMessage): +    test_results: list[UnittestError] + +  class SubmitForm(Route):      """      Submit a form with the provided form ID. @@ -58,7 +70,8 @@ class SubmitForm(Route):          resp=Response(              HTTP_200=SubmissionResponse,              HTTP_404=ErrorMessage, -            HTTP_400=ErrorMessage +            HTTP_400=ErrorMessage, +            HTTP_422=UnittestErrorMessage          ),          tags=["forms", "responses"]      ) | 
