Exemplo n.º 1
0
	def test_Right_Code_Scoring(self):
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "booster.cpp", mydir + "booster", mydir, 30), [20, "Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([15,5,5,5,5], mydir + "booster.cpp", mydir + "booster", mydir, 30), [30, "Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([5,25,5,5,5], mydir + "booster.cpp", mydir + "booster", mydir, 30), [40,"Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([5,5,35,5,5], mydir + "booster.cpp", mydir + "booster", mydir, 30), [50, "Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([5,5,5,45,5], mydir + "booster.cpp", mydir + "booster", mydir, 30), [60, "Compiled and ran fully."])
Exemplo n.º 2
0
	def test_Bad_Code(self):
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "no_compile.cpp", mydir + "no_compile", mydir, 30), [0, "Could not compile."])
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "no_compile_2.cpp", mydir + "no_compile_2", mydir, 30), [0, "Could not compile."])
Exemplo n.º 3
0
	def test_Some_Wrong_Code_Scoring(self):
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "booster_2.cpp", mydir + "booster_2", mydir, 30), [15, "Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "booster_3.cpp", mydir + "booster_3", mydir, 30), [10, "Compiled and ran fully."])
		self.assertEqual(code_grader.run_unit_test([5,5,5,5,5], mydir + "booster_4.cpp", mydir + "booster_4", mydir, 30), [5, "Compiled and ran fully."])