diff --git a/.gitignore b/.gitignore index 0d20b64..8aaadd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.pyc +.codex/ +.claude/ diff --git a/polygon_api/api.py b/polygon_api/api.py index c161420..fb85b93 100644 --- a/polygon_api/api.py +++ b/polygon_api/api.py @@ -337,6 +337,28 @@ def problem_tests(self, problem_id, testset, no_inputs=None): ) return [Test.from_json(self, problem_id, testset, js) for js in response.result] + def problem_test_input(self, problem_id, testset, test_index): + response = self._request_raw( + self._PROBLEM_TEST_INPUT, + args={ + 'problemId': problem_id, + 'testset': testset, + 'testIndex': test_index, + } + ) + return response + + def problem_test_answer(self, problem_id, testset, test_index): + response = self._request_raw( + self._PROBLEM_TEST_ANSWER, + args={ + 'problemId': problem_id, + 'testset': testset, + 'testIndex': test_index, + } + ) + return response + def problem_save_test_group(self, problem_id, testset, group, points_policy=None, feedback_policy=None, dependencies=None): if isinstance(dependencies, list): @@ -621,6 +643,12 @@ def save_test(self, testset, test_index, test_input, test_group=None, test_point def tests(self, testset, no_inputs=None): return self._polygon.problem_tests(self.id, testset, no_inputs) + def test_input(self, testset, test_index): + return self._polygon.problem_test_input(self.id, testset, test_index) + + def test_answer(self, testset, test_index): + return self._polygon.problem_test_answer(self.id, testset, test_index) + def save_test_group(self, testset, group, points_policy=None, feedback_policy=None, dependencies=None): return self._polygon.problem_save_test_group(self.id, testset, group, points_policy, feedback_policy, dependencies) @@ -713,8 +741,8 @@ class Test: _SCRIPT_LINE = "scriptLine" _GROUP = "group" _POINTS = "points" - _INPUT_FOR_STATEMENTS = "inputForStatements" - _OUTPUT_FOR_STATEMENTS = "outputForStatements" + _INPUT_FOR_STATEMENTS = "inputForStatement" + _OUTPUT_FOR_STATEMENTS = "outputForStatement" _VERIFY_INPUT_OUTPUT_FOR_STATEMENTS = "verifyInputOutputForStatements" @classmethod