Skip to content

Commit

Permalink
test changes for autograde
Browse files Browse the repository at this point in the history
  • Loading branch information
sydfromm committed Apr 23, 2024
1 parent a275eac commit c3f993a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nbgrader/tests/apps/test_nbgrader_autograde.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,22 @@ def test_grade(self, db, course_dir):
run_nbgrader(["db", "assignment", "add", "ps1", "--db", db, "--duedate", "2015-02-02 14:58:23.948203 America/Los_Angeles"])
run_nbgrader(["db", "student", "add", "foo", "--db", db])
run_nbgrader(["db", "student", "add", "bar", "--db", db])
run_nbgrader(["db", "student", "add", "\student", "--db", db])

self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb"))
run_nbgrader(["generate_assignment", "ps1", "--db", db])

self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb"))
self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "bar", "ps1", "p1.ipynb"))
self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "\student", "ps1", "p1.ipynb"))
run_nbgrader(["autograde", "ps1", "--db", db])

assert os.path.isfile(join(course_dir, "autograded", "foo", "ps1", "p1.ipynb"))
assert not os.path.isfile(join(course_dir, "autograded", "foo", "ps1", "timestamp.txt"))
assert os.path.isfile(join(course_dir, "autograded", "bar", "ps1", "p1.ipynb"))
assert not os.path.isfile(join(course_dir, "autograded", "bar", "ps1", "timestamp.txt"))
assert os.path.isfile(join(course_dir, "autograded", "\student", "ps1", "p1.ipynb"))
assert not os.path.isfile(join(course_dir, "autograded", "\student", "ps1", "timestamp.txt"))

with Gradebook(db) as gb:
notebook = gb.find_submission_notebook("p1", "ps1", "foo")
Expand Down

0 comments on commit c3f993a

Please sign in to comment.