Skip to content

Commit

Permalink
test case for file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
bloomsa committed Nov 10, 2023
1 parent 252e8a2 commit 3d5cb0a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/services/contents/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,15 @@ async def test_404(jp_file_contents_manager_class, tmp_path):
except HTTPError as e:
assert e.status_code == 404

# Test file not found
td = str(tmp_path)
cm = jp_file_contents_manager_class(root_dir=td)
os_path = cm._get_os_path(td)
not_a_file = os.path.join(os_path, "foo.bar")
with pytest.raises(HTTPError) as excinfo:
result = await ensure_async(cm.get(not_a_file, "w"))
assert excinfo.value.status_code == 404


async def test_escape_root(jp_file_contents_manager_class, tmp_path):
td = str(tmp_path)
Expand Down

0 comments on commit 3d5cb0a

Please sign in to comment.