diff options
author | 2021-06-03 03:02:01 +0300 | |
---|---|---|
committer | 2021-06-03 03:02:21 +0300 | |
commit | 9991a8e8031ab6c1d33577bc759a6c7b03183ea3 (patch) | |
tree | 034e513bc3e55dbd04f2a0f1e46993a6cfb40640 /backend | |
parent | Adds Missing Docstrings (diff) |
Clarify Validator Semantics
Co-authored-by: Chris <[email protected]>
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend')
-rw-r--r-- | backend/models/question.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/models/question.py b/backend/models/question.py index 8972bc1..5a1334a 100644 --- a/backend/models/question.py +++ b/backend/models/question.py @@ -15,7 +15,7 @@ class Unittests(BaseModel): @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()): + if isinstance(value, dict) and len(value.keys()) == 0: raise ValueError("Must have at least one test in a test suite.") return value |