Skip to content

Commit b83a51a

Browse files
committed
Exercise duplicate POST keys in functional test
1 parent d3ed6e0 commit b83a51a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/functional/forklift/test_legacy.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import pymacaroons
1818
import pytest
1919

20+
from webob.multidict import MultiDict
21+
2022
from warehouse.macaroons import caveats
2123

2224
from ...common.db.accounts import UserFactory
@@ -90,18 +92,24 @@ def test_file_upload(webtest):
9092
with open("./tests/functional/_fixtures/sampleproject-3.0.0.tar.gz", "rb") as f:
9193
content = f.read()
9294

93-
webtest.post(
94-
"/legacy/?:action=file_upload",
95-
headers={"Authorization": f"Basic {credentials}"},
96-
params={
95+
params = MultiDict(
96+
{
9797
"name": "sampleproject",
9898
"sha256_digest": (
9999
"117ed88e5db073bb92969a7545745fd977ee85b7019706dd256a64058f70963d"
100100
),
101101
"filetype": "sdist",
102102
"metadata_version": "2.1",
103103
"version": "3.0.0",
104-
},
104+
}
105+
)
106+
params.add("project-url", "https://example.com/foo")
107+
params.add("project-url", "https://example.com/bar")
108+
109+
webtest.post(
110+
"/legacy/?:action=file_upload",
111+
headers={"Authorization": f"Basic {credentials}"},
112+
params=params,
105113
upload_files=[("content", "sampleproject-3.0.0.tar.gz", content)],
106114
status=HTTPStatus.OK,
107115
)

0 commit comments

Comments
 (0)