diff --git a/app/api/schema/exercise.py b/app/api/schema/exercise.py index 66d890d..f5fc826 100644 --- a/app/api/schema/exercise.py +++ b/app/api/schema/exercise.py @@ -31,6 +31,7 @@ class TestCaseCreate(BaseModel): postcondition: SystemState user_input: list[str] expected_output: list[str] + expected_instructions: list[str] class TestCaseRead(TestCaseCreate): diff --git a/app/db/model/exercise.py b/app/db/model/exercise.py index 04f9366..a043a6b 100644 --- a/app/db/model/exercise.py +++ b/app/db/model/exercise.py @@ -32,6 +32,7 @@ class TestCase(Base): postcondition = sa.Column(sa.JSON, nullable=False) user_input = sa.Column(sa.JSON, nullable=False) expected_output = sa.Column(sa.JSON, nullable=False) + expected_instructions = sa.Column(sa.JSON, nullable=False) def to_dict(self): return { @@ -42,6 +43,7 @@ def to_dict(self): "postcondition": self.postcondition, "user_input": self.user_input, "expected_output": self.expected_output, + "expected_instructions": self.expected_instructions, } diff --git a/tests/test_exercise.py b/tests/test_exercise.py index 34b3973..e7e93f8 100644 --- a/tests/test_exercise.py +++ b/tests/test_exercise.py @@ -133,7 +133,8 @@ def test_post_test_case(self): "memory": {} }, "user_input": ["10", "20"], - "expected_output": ["30"] + "expected_output": ["30"], + "expected_instructions": [], } response = client.post("/exercises/1/test-cases", json=new_test_case) diff --git a/tests/util/demo_data.py b/tests/util/demo_data.py index b57d717..483477f 100644 --- a/tests/util/demo_data.py +++ b/tests/util/demo_data.py @@ -155,7 +155,8 @@ "memory": {} }, "user_input": ["4", "5"], - "expected_output": ["20"] + "expected_output": ["20"], + "expected_instructions": [] } ] }