Skip to content

Commit 1a1d5ea

Browse files
authored
Merge pull request #24 from simple-repository/feature/follow-redirects-for-resources
Make the tests deterministic
2 parents 89fd4df + 4116349 commit 1a1d5ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

simple_repository_server/tests/integration/test_repo_dependency_injection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ async def test_repo_with_dependency_injection__project_page(
107107

108108
assert response.status_code == 200
109109
assert response.headers['content-type'] == 'application/vnd.pypi.simple.v1+json'
110-
assert response.json() == {
110+
111+
response_data = response.json()
112+
expected_data = {
111113
"meta": {
112114
"api-version": "1.1",
113115
},
@@ -132,6 +134,10 @@ async def test_repo_with_dependency_injection__project_page(
132134
],
133135
}
134136

137+
# The version sort order is not currently deterministic, so test that separately.
138+
assert set(response_data.pop("versions")) == set(expected_data.pop("versions"))
139+
assert response_data == expected_data
140+
135141

136142
@pytest.mark.asyncio
137143
async def test_repo_with_dependency_injection__project_page__redirect(

0 commit comments

Comments
 (0)