diff options
Diffstat (limited to 'yaksh/tests/test_code_server.py')
-rw-r--r-- | yaksh/tests/test_code_server.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/yaksh/tests/test_code_server.py b/yaksh/tests/test_code_server.py index a647481..e2781df 100644 --- a/yaksh/tests/test_code_server.py +++ b/yaksh/tests/test_code_server.py @@ -125,6 +125,21 @@ class TestCodeServer(unittest.TestCase): data = json.loads(result.get('result')) self.assertFalse(data['success']) + # With correct answer and test case + testdata["metadata"]["user_answer"] = 'def f(): return 2' + testdata["test_case_data"] = [{'test_case': 'assert f() == 2', + 'test_case_type': 'standardtestcase', + 'weight': 0.0 + } + ] + # When + submit(self.url, '0', json.dumps(testdata), '') + result = get_result(self.url, '0', block=True) + + # Then + data = json.loads(result.get('result')) + self.assertTrue(data['success']) + def test_multiple_simultaneous_hits(self): # Given results = Queue() |