Skip to content

Commit a63b1ac

Browse files
committed
Exercise duplicate POST keys in functional test
1 parent c979275 commit a63b1ac

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/functional/forklift/test_legacy.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import pymacaroons
1818
import pytest
19+
from webob.multidict import MultiDict
1920

2021
from warehouse.macaroons import caveats
2122

@@ -90,18 +91,24 @@ def test_file_upload(webtest):
9091
with open("./tests/functional/_fixtures/sampleproject-3.0.0.tar.gz", "rb") as f:
9192
content = f.read()
9293

93-
webtest.post(
94-
"/legacy/?:action=file_upload",
95-
headers={"Authorization": f"Basic {credentials}"},
96-
params={
94+
params = MultiDict(
95+
{
9796
"name": "sampleproject",
9897
"sha256_digest": (
9998
"117ed88e5db073bb92969a7545745fd977ee85b7019706dd256a64058f70963d"
10099
),
101100
"filetype": "sdist",
102101
"metadata_version": "2.1",
103102
"version": "3.0.0",
104-
},
103+
}
104+
)
105+
params.add("project-url", "https://example.com/foo")
106+
params.add("project-url", "https://example.com/bar")
107+
108+
webtest.post(
109+
"/legacy/?:action=file_upload",
110+
headers={"Authorization": f"Basic {credentials}"},
111+
params=params,
105112
upload_files=[("content", "sampleproject-3.0.0.tar.gz", content)],
106113
status=HTTPStatus.OK,
107114
)

0 commit comments

Comments
 (0)