@@ -18,9 +18,6 @@ def assert_correct_output(self, expected_output, actual_output):
1818
1919class PythonAssertionEvaluationTestCases (EvaluatorBaseTest ):
2020 def setUp (self ):
21- self .tmp_file = os .path .join (tempfile .gettempdir (), "test.txt" )
22- with open (self .tmp_file , 'wb' ) as f :
23- f .write ('2' .encode ('ascii' ))
2421 tmp_in_dir_path = tempfile .mkdtemp ()
2522 self .in_dir = tmp_in_dir_path
2623 self .test_case_data = [{"test_case_type" : "standardtestcase" ,
@@ -927,41 +924,5 @@ def check_answer(user_answer):
927924 result .get ("error" )[0 ]["message" ]
928925 )
929926
930- def test_assignment_upload (self ):
931- # Given
932- user_answer = "Assignment Upload"
933- hook_code = dedent ("""\
934- def check_answer(user_answer):
935- success = False
936- err = "Incorrect Answer"
937- mark_fraction = 0.0
938- with open("test.txt") as f:
939- data = f.read()
940- if data == '2':
941- success, err, mark_fraction = True, "", 1.0
942- return success, err, mark_fraction
943- """
944- )
945-
946- test_case_data = [{"test_case_type" : "hooktestcase" ,
947- "hook_code" : hook_code , "weight" : 1.0
948- }]
949- kwargs = {'metadata' : {
950- 'user_answer' : user_answer ,
951- 'file_paths' : self .file_paths ,
952- 'assign_files' : [self .tmp_file ],
953- 'partial_grading' : False ,
954- 'language' : 'python' },
955- 'test_case_data' : test_case_data ,
956- }
957-
958- # When
959- grader = Grader (self .in_dir )
960- result = grader .evaluate (kwargs )
961-
962- # Then
963- self .assertTrue (result .get ('success' ))
964-
965-
966927if __name__ == '__main__' :
967928 unittest .main ()
0 commit comments