def testCompile(self): self.createMockSubmission('addnumbers', 'compilesuccess.go') directory = judge.directory_for_submission(self.submit) os.mkdir(directory) self.submit_file.save( os.path.join(directory, self.submit_file.filename)) self.assertEqual( judge.COMPILATION_SUCCESS, judge.compile_submission(self.submit, self.submit_file))
def assertCompilation(self, expected_result): """Assert the behavior of a compilation. A MockSubmission must first be created with createMockSubmission. :param expected_result: the expected result for this submission. Normally one of the constants exposed by the judge module. :return: None """ directory = judge.directory_for_submission(self.submit) os.mkdir(directory) self.submit_file.save( os.path.join(directory, self.submit_file.filename)) self.assertEqual( expected_result, judge.compile_submission(self.submit, self.submit_file))