Skip to content

Commit

Permalink
make nbconvert API test less dependent on nbconvert versions (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer authored Nov 1, 2021
1 parent 29be9c6 commit 6bd015c
Showing 1 changed file with 7 additions and 3 deletions.
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."

0 comments on commit 6bd015c

Please sign in to comment.