From ee15ceccc8b2b690d0c383ac596ca95c36180a9a Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Wed, 2 Jun 2021 13:35:21 +0300 Subject: Adds Missing Docstrings Signed-off-by: Hassan Abouelela --- backend/models/question.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backend/models') diff --git a/backend/models/question.py b/backend/models/question.py index 9829843..8972bc1 100644 --- a/backend/models/question.py +++ b/backend/models/question.py @@ -8,11 +8,13 @@ _TESTS_TYPE = t.Union[t.Dict[str, str], int] class Unittests(BaseModel): + """Schema model for unittest suites in code questions.""" allow_failure: bool = False tests: _TESTS_TYPE @validator("tests") def validate_tests(cls, value: _TESTS_TYPE) -> _TESTS_TYPE: + """Confirm that at least one test exists in a test suite.""" if isinstance(value, dict) and not len(value.keys()): raise ValueError("Must have at least one test in a test suite.") @@ -20,6 +22,7 @@ class Unittests(BaseModel): class CodeQuestion(BaseModel): + """Schema model for questions of type `code`.""" language: str unittests: t.Optional[Unittests] -- cgit v1.2.3