1212def test_base ():
1313 with (
1414 patch ("log_and_order.verify.get_head_sha" , return_value = "a" * 15 ),
15- patch ("log_and_order.verify.get_head_message" , return_value = "Hello world" ),
15+ patch (
16+ "log_and_order.verify.get_target_commit_message" , return_value = "Hello world"
17+ ),
1618 patch ("log_and_order.verify.get_target_commit_sha" , return_value = "b" * 15 ),
1719 loader .load (
1820 "specs/base.yml" ,
1921 "start" ,
2022 mock_answers = {
2123 QUESTION_ONE : "a" * 7 ,
22- QUESTION_TWO : "Hello world" ,
24+ QUESTION_TWO . format ( SHA = "hi" ) : "Hello world" ,
2325 QUESTION_THREE : "b" * 7 ,
2426 },
2527 ) as output ,
@@ -30,14 +32,16 @@ def test_base():
3032def test_wrong_head_sha ():
3133 with (
3234 patch ("log_and_order.verify.get_head_sha" , return_value = "a" * 15 ),
33- patch ("log_and_order.verify.get_head_message" , return_value = "Hello world" ),
35+ patch (
36+ "log_and_order.verify.get_target_commit_message" , return_value = "Hello world"
37+ ),
3438 patch ("log_and_order.verify.get_target_commit_sha" , return_value = "b" * 15 ),
3539 loader .load (
3640 "specs/base.yml" ,
3741 "start" ,
3842 mock_answers = {
3943 QUESTION_ONE : "b" * 7 ,
40- QUESTION_TWO : "Hello world" ,
44+ QUESTION_TWO . format ( SHA = "hi" ) : "Hello world" ,
4145 QUESTION_THREE : "b" * 7 ,
4246 },
4347 ) as output ,
@@ -52,36 +56,44 @@ def test_wrong_head_sha():
5256def test_wrong_head_message ():
5357 with (
5458 patch ("log_and_order.verify.get_head_sha" , return_value = "a" * 15 ),
55- patch ("log_and_order.verify.get_head_message" , return_value = "Hello world" ),
59+ patch (
60+ "log_and_order.verify.get_target_commit_message" , return_value = "Hello world"
61+ ),
5662 patch ("log_and_order.verify.get_target_commit_sha" , return_value = "b" * 15 ),
5763 loader .load (
5864 "specs/base.yml" ,
5965 "start" ,
6066 mock_answers = {
6167 QUESTION_ONE : "a" * 7 ,
62- QUESTION_TWO : "Bye world" ,
68+ QUESTION_TWO . format ( SHA = "hi" ) : "Bye world" ,
6369 QUESTION_THREE : "b" * 7 ,
6470 },
6571 ) as output ,
6672 ):
6773 assert_output (
6874 output ,
6975 GitAutograderStatus .UNSUCCESSFUL ,
70- [HasExactValueRule .NOT_EXACT .format (question = QUESTION_TWO )],
76+ [
77+ HasExactValueRule .NOT_EXACT .format (
78+ question = QUESTION_TWO .format (SHA = "hi" )
79+ )
80+ ],
7181 )
7282
7383
7484def test_wrong_target_sha ():
7585 with (
7686 patch ("log_and_order.verify.get_head_sha" , return_value = "a" * 15 ),
77- patch ("log_and_order.verify.get_head_message" , return_value = "Hello world" ),
87+ patch (
88+ "log_and_order.verify.get_target_commit_message" , return_value = "Hello world"
89+ ),
7890 patch ("log_and_order.verify.get_target_commit_sha" , return_value = "b" * 15 ),
7991 loader .load (
8092 "specs/base.yml" ,
8193 "start" ,
8294 mock_answers = {
8395 QUESTION_ONE : "a" * 7 ,
84- QUESTION_TWO : "Hello world" ,
96+ QUESTION_TWO . format ( SHA = "hi" ) : "Hello world" ,
8597 QUESTION_THREE : "a" * 7 ,
8698 },
8799 ) as output ,
0 commit comments