jupyter-server / jupyter_server

The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.
https://jupyter-server.readthedocs.io
BSD 3-Clause "New" or "Revised" License
489 stars 308 forks source link

ContentsHandler return 404 rather than raise exc #1357

Closed bloomsa closed 1 year ago

bloomsa commented 1 year ago

this addresses #1328. This works based on my testing but I'm more than happy to make structural changes to clean the code up. I'm admittedly not very well versed in tornado. Thanks in advance for feedback :)

image
bloomsa commented 1 year ago

I see one of the test actions, build (windows latest 3.9), failed but I'm not sure it's related since the code change doesn't seem to touch the affected test case

blink1073 commented 1 year ago

I see one of the test actions, build (windows latest 3.9), failed but I'm not sure it's related since the code change doesn't seem to touch the affected test case

That is a known flaky test.

blink1073 commented 1 year ago

Changes look good! Can you please add a test in https://github.com/jupyter-server/jupyter_server/blob/main/tests/services/contents/test_manager.py that tries to get a file that doesn't exist and ensures that a 404 is raised?

bloomsa commented 1 year ago

Changes look good! Can you please add a test in https://github.com/jupyter-server/jupyter_server/blob/main/tests/services/contents/test_manager.py that tries to get a file that doesn't exist and ensures that a 404 is raised?

done in my latest commit. couple of questions though

blink1073 commented 1 year ago

Hey @bloomsa, I agree the w is a logic error currently. I also think the previous blocks probably suffered from the move from nose to pytest are incorrect as well. The previous one isn't actually testing anything. 😅

bloomsa commented 1 year ago

I'm working on fixing the test cases for windows (actually led me to a bug in the tests that I'll fix 👍 ) would you like me to fix these as part of this PR? I can do it no problem @blink1073

I agree the w is a logic error currently. I also think the previous blocks probably suffered from the move from nose to pytest are incorrect as well.

blink1073 commented 1 year ago

Yes please!

blink1073 commented 1 year ago

@Wh1isper, I'll wait for you to take another look.

Wh1isper commented 1 year ago

@blink1073 LGTM, thx