File tree Expand file tree Collapse file tree 5 files changed +78
-5
lines changed Expand file tree Collapse file tree 5 files changed +78
-5
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,12 @@ initialization:
4
4
empty : true
5
5
message : Empty commit
6
6
id : start
7
+ - type : new-file
8
+ filename : script.py
9
+ contents : |
10
+ print("Hello Everyone and World!")
11
+ - type : add
12
+ files :
13
+ - script.py
14
+ - type : commit
15
+ message : Fix print
Original file line number Diff line number Diff line change
1
+ initialization :
2
+ steps :
3
+ - type : commit
4
+ empty : true
5
+ message : Empty commit
6
+ id : start
7
+ - type : new-file
8
+ filename : script.py
9
+ contents : |
10
+ print("Hello World!")
11
+ - type : add
12
+ files :
13
+ - script.py
14
+ - type : commit
15
+ message : No fix print
Original file line number Diff line number Diff line change
1
+ initialization :
2
+ steps :
3
+ - type : commit
4
+ empty : true
5
+ message : Empty
6
+ id : start
7
+ - type : branch
8
+ branch-name : bug-fix
Original file line number Diff line number Diff line change
1
+ initialization :
2
+ steps :
3
+ - type : new-file
4
+ filename : test.txt
5
+ contents : |
6
+ hi
7
+ - type : add
8
+ files :
9
+ - test.txt
10
+ - type : commit
11
+ message : Start
12
+ id : start
13
+ - type : edit-file
14
+ filename : test.txt
15
+ contents : |
16
+ changed
Original file line number Diff line number Diff line change 1
- from git_autograder import GitAutograderTestLoader
1
+ from git_autograder import GitAutograderStatus , GitAutograderTestLoader , assert_output
2
2
3
- from ..verify import verify
3
+ from ..verify import (
4
+ MERGE_NOT_RESOLVED ,
5
+ NOT_ON_MAIN ,
6
+ RESET_MESSAGE ,
7
+ UNCOMMITTED_CHANGES ,
8
+ verify ,
9
+ )
4
10
5
11
REPOSITORY_NAME = "conflict-mediator"
6
12
7
13
loader = GitAutograderTestLoader (__file__ , REPOSITORY_NAME , verify )
8
14
9
15
10
- def test ():
11
- with loader .load ("specs/base.yml" , "start" ):
12
- pass
16
+ def test_base ():
17
+ with loader .load ("specs/base.yml" , "start" ) as output :
18
+ assert_output (output , GitAutograderStatus .SUCCESSFUL )
19
+
20
+
21
+ def test_no_fix ():
22
+ with loader .load ("specs/no_fix.yml" , "start" ) as output :
23
+ assert_output (
24
+ output ,
25
+ GitAutograderStatus .UNSUCCESSFUL ,
26
+ [MERGE_NOT_RESOLVED , RESET_MESSAGE ],
27
+ )
28
+
29
+
30
+ def test_uncommitted ():
31
+ with loader .load ("specs/uncommitted.yml" ) as output :
32
+ assert_output (output , GitAutograderStatus .UNSUCCESSFUL , [UNCOMMITTED_CHANGES ])
33
+
34
+
35
+ def test_not_main ():
36
+ with loader .load ("specs/not_main.yml" ) as output :
37
+ assert_output (output , GitAutograderStatus .UNSUCCESSFUL , [NOT_ON_MAIN ])
You can’t perform that action at this time.
0 commit comments