Skip to content

Commit f354898

Browse files
committed
fixup! fixup! Add the outline for structured output
1 parent 88d748b commit f354898

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/functional/test_index.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ def test_json_structured_output(script: PipTestEnvironment) -> None:
1616
output = script.pip("index", "versions", "pip", "--json", allow_stderr_warning=True)
1717
structured_output = json.loads(output.stdout)
1818

19+
assert isinstance(structured_output, dict)
1920
assert "name" in structured_output
20-
assert "versions" in structured_output
21+
assert structured_output["name"] == "pip"
2122
assert "latest" in structured_output
23+
assert isinstance(structured_output["latest"], str)
24+
assert "versions" in structured_output
25+
assert isinstance(structured_output["versions"], list)
2226
assert (
2327
"20.2.3, 20.2.2, 20.2.1, 20.2, 20.1.1, 20.1, 20.0.2"
2428
", 20.0.1, 19.3.1, 19.3, 19.2.3, 19.2.2, 19.2.1, 19.2, 19.1.1"
@@ -30,7 +34,7 @@ def test_json_structured_output(script: PipTestEnvironment) -> None:
3034
"1.5.2, 1.5.1, 1.5, 1.4.1, 1.4, 1.3.1, 1.3, 1.2.1, 1.2, 1.1, 1.0.2,"
3135
" 1.0.1, 1.0, 0.8.3, 0.8.2, 0.8.1, 0.8, 0.7.2, 0.7.1, 0.7, 0.6.3, "
3236
"0.6.2, 0.6.1, 0.6, 0.5.1, 0.5, 0.4, 0.3.1, "
33-
"0.3, 0.2.1, 0.2" in ", ".join(structured_output.get("versions"))
37+
"0.3, 0.2.1, 0.2" in ", ".join(structured_output["versions"])
3438
)
3539

3640

0 commit comments

Comments
 (0)