Skip to content

Commit

Permalink
ensure timestamp.txt test
Browse files Browse the repository at this point in the history
  • Loading branch information
tuncbkose committed Jul 12, 2023
1 parent 17dfda2 commit af5fe32
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nbgrader/tests/apps/test_nbgrader_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,16 @@ def test_submit_max_dir_size(self, exchange, cache, course_dir):
self._make_file(join("ps1", "large_file"), contents="x" * 2001)
with pytest.raises(RuntimeError):
self._submit("ps1", exchange, cache,
flags=['--CourseDirectory.max_dir_size=3'])
flags=['--CourseDirectory.max_dir_size=3'])

def test_ensure_timestamp(self, exchange, cache, course_dir):
# Ensure timestamp is created even if something goes wrong in submitting
# If timestamp is not created, feedback workflow can be broken
# see: https://github.com/jupyter/nbgrader/pull/1755
self._release_and_fetch("ps1", exchange, cache, course_dir)
os.chmod("ps1/p1.ipynb", 0o244)
with pytest.raises(OSError):
self._submit("ps1", exchange, cache)
os.chmod("ps1/p1.ipynb", 0o644)
dirname = os.listdir(join(exchange, "abc101", "inbound"))[0]
assert os.path.isfile(join(exchange, "abc101", "inbound", dirname, "timestamp.txt"))

0 comments on commit af5fe32

Please sign in to comment.