@@ -94,6 +94,22 @@ def test_check_correct(sct, passes, msg):
9494 assert output ['correct' ] == passes
9595 if msg : assert output ['message' ] == msg
9696
97+ @pytest .mark .parametrize ('sct, passes, msg' , [
98+ ("Ex().check_correct(has_code('a'), has_code('b'))" , False , None ),
99+ ("Ex().check_correct(has_code('a'), has_code('c'))" , False , None ),
100+ ("Ex().check_correct(has_code('b'), has_code('c', not_typed_msg='x'))" , False , 'x' ),
101+ ("Ex().check_correct(has_code('b', not_typed_msg='x'), has_code('a'))" , False , 'x' )
102+ ])
103+ def test_check_correct_force_diagnose (sct , passes , msg ):
104+ data = {
105+ 'DC_CODE' : "'a'" ,
106+ 'DC_SCT' : sct ,
107+ 'DC_FORCE_DIAGNOSE' : True
108+ }
109+ output = helper .run (data )
110+ assert output ['correct' ] == passes
111+ if msg : assert output ['message' ] == msg
112+
97113@pytest .mark .parametrize ('sct, passes, msg' , [
98114 ("test_correct(lambda: test_student_typed('a'), lambda: test_student_typed('b'))" , True , None ),
99115 ("test_correct(test_student_typed('a'), test_student_typed('b'))" , True , None ),
0 commit comments