|
1 | | -from git_autograder import GitAutograderTestLoader |
| 1 | +from git_autograder import GitAutograderTestLoader, assert_output |
| 2 | +from git_autograder.status import GitAutograderStatus |
2 | 3 |
|
3 | | -from ..verify import verify |
| 4 | +from ..verify import EXTRA_FILES_UNSTAGED, MISSING_FILES_UNSTAGED, verify |
4 | 5 |
|
5 | 6 | REPOSITORY_NAME = "staging-intervention" |
6 | 7 |
|
7 | 8 | loader = GitAutograderTestLoader(__file__, REPOSITORY_NAME, verify) |
8 | 9 |
|
9 | 10 |
|
10 | | -def test(): |
11 | | - with loader.load("specs/base.yml", "start"): |
12 | | - pass |
| 11 | +def test_base(): |
| 12 | + with loader.load("specs/base.yml", "start") as output: |
| 13 | + assert_output(output, GitAutograderStatus.SUCCESSFUL) |
| 14 | + |
| 15 | + |
| 16 | +def test_extra_unstaged(): |
| 17 | + with loader.load("specs/extra_unstaged.yml", "start") as output: |
| 18 | + assert_output(output, GitAutograderStatus.UNSUCCESSFUL, [EXTRA_FILES_UNSTAGED]) |
| 19 | + |
| 20 | + |
| 21 | +def test_missing_unstaged(): |
| 22 | + with loader.load("specs/missing_unstaged.yml", "start") as output: |
| 23 | + assert_output( |
| 24 | + output, GitAutograderStatus.UNSUCCESSFUL, [MISSING_FILES_UNSTAGED] |
| 25 | + ) |
| 26 | + |
| 27 | + |
| 28 | +def test_mixed_unstaged(): |
| 29 | + with loader.load("specs/mixed_unstaged.yml", "start") as output: |
| 30 | + assert_output( |
| 31 | + output, |
| 32 | + GitAutograderStatus.UNSUCCESSFUL, |
| 33 | + [EXTRA_FILES_UNSTAGED, MISSING_FILES_UNSTAGED], |
| 34 | + ) |
0 commit comments