Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid dependency on NBConvert versions for REST API test #601

Merged
merged 1 commit into from
Nov 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions jupyter_server/tests/services/nbconvert/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
async def test_list_formats(jp_fetch):
r = await jp_fetch("api", "nbconvert", method="GET")
formats = json.loads(r.body.decode())
# Verify the type of the response.
assert isinstance(formats, dict)
assert "python" in formats
assert "html" in formats
assert formats["python"]["output_mimetype"] == "text/x-python"
# Verify that all returned formats have an
# output mimetype defined.
required_keys_present = []
for name, data in formats.items():
required_keys_present.append("output_mimetype" in data)
assert all(required_keys_present), "All returned formats must have a `output_mimetype` key."