Skip to content

Commit af5fe32

Browse files
committed
ensure timestamp.txt test
1 parent 17dfda2 commit af5fe32

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

nbgrader/tests/apps/test_nbgrader_submit.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,16 @@ def test_submit_max_dir_size(self, exchange, cache, course_dir):
248248
self._make_file(join("ps1", "large_file"), contents="x" * 2001)
249249
with pytest.raises(RuntimeError):
250250
self._submit("ps1", exchange, cache,
251-
flags=['--CourseDirectory.max_dir_size=3'])
251+
flags=['--CourseDirectory.max_dir_size=3'])
252+
253+
def test_ensure_timestamp(self, exchange, cache, course_dir):
254+
# Ensure timestamp is created even if something goes wrong in submitting
255+
# If timestamp is not created, feedback workflow can be broken
256+
# see: https://github.com/jupyter/nbgrader/pull/1755
257+
self._release_and_fetch("ps1", exchange, cache, course_dir)
258+
os.chmod("ps1/p1.ipynb", 0o244)
259+
with pytest.raises(OSError):
260+
self._submit("ps1", exchange, cache)
261+
os.chmod("ps1/p1.ipynb", 0o644)
262+
dirname = os.listdir(join(exchange, "abc101", "inbound"))[0]
263+
assert os.path.isfile(join(exchange, "abc101", "inbound", dirname, "timestamp.txt"))

0 commit comments

Comments
 (0)