feat(practice): store code submissions and practice states apart from attempts
This commit is contained in:
1 parent
d5e169e71b
commit
51770eea6c
61 files changed
+8584
-135
No files matched your search
@@ -362,6 +362,26 @@ class AssessmentContractTest(unittest.TestCase):
|
||||
self.assertIn("employer", result_description)
|
||||
self.assertIn("404", self.paths["/api/v1/me/assessment-attempts/{attempt_id}"]["get"]["responses"])
|
||||
|
||||
def test_practice_runs_never_name_hidden_checks_or_scores(self) -> None:
|
||||
forbidden = {"hidden", "hidden_checks", "hidden_groups", "seed", "score", "verdict", "source_code"}
|
||||
run_schemas = (
|
||||
"PracticeRun",
|
||||
"PracticeRunResult",
|
||||
"PracticeRunTestResult",
|
||||
)
|
||||
for name in run_schemas:
|
||||
schema = self.schemas[name]
|
||||
self.assertFalse(forbidden.intersection(schema.get("properties", {})), name)
|
||||
self.assertFalse(schema.get("additionalProperties", True), name)
|
||||
create = self.paths["/api/v1/me/assessment-attempts/{attempt_id}/practice-runs"]["post"]
|
||||
read = self.paths["/api/v1/me/assessment-attempts/{attempt_id}/practice-runs/{run_id}"]["get"]
|
||||
self.assertEqual(create["operationId"], "CreateMyAssessmentPracticeRun")
|
||||
self.assertEqual(read["operationId"], "GetMyAssessmentPracticeRun")
|
||||
for operation, status in ((create, "202"), (read, "200")):
|
||||
response = operation["responses"][status]["content"]["application/json"]["schema"]
|
||||
self.assertEqual(referenced_schema_name(response), "PracticeRun")
|
||||
self.assertNotIn("post", self.paths["/api/v1/me/assessment-attempts/{attempt_id}/practice-runs/{run_id}"])
|
||||
|
||||
def test_signal_operation_is_bounded_private_and_separate_from_results(self) -> None:
|
||||
operation = self.paths[
|
||||
"/api/v1/me/assessment-attempts/{attempt_id}/signals"
|
||||
|
||||
Reference in new issue
Block a user