Skip to content

Commit 6bd015c

Browse files
authored
make nbconvert API test less dependent on nbconvert versions (#601)
1 parent 29be9c6 commit 6bd015c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jupyter_server/tests/services/nbconvert/test_api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
async def test_list_formats(jp_fetch):
55
r = await jp_fetch("api", "nbconvert", method="GET")
66
formats = json.loads(r.body.decode())
7+
# Verify the type of the response.
78
assert isinstance(formats, dict)
8-
assert "python" in formats
9-
assert "html" in formats
10-
assert formats["python"]["output_mimetype"] == "text/x-python"
9+
# Verify that all returned formats have an
10+
# output mimetype defined.
11+
required_keys_present = []
12+
for name, data in formats.items():
13+
required_keys_present.append("output_mimetype" in data)
14+
assert all(required_keys_present), "All returned formats must have a `output_mimetype` key."

0 commit comments

Comments
 (0)