Skip to content

Commit

Permalink
Exercise duplicate POST keys in functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Sep 19, 2024
1 parent d3ed6e0 commit b83a51a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/functional/forklift/test_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import pymacaroons
import pytest

from webob.multidict import MultiDict

from warehouse.macaroons import caveats

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

webtest.post(
"/legacy/?:action=file_upload",
headers={"Authorization": f"Basic {credentials}"},
params={
params = MultiDict(
{
"name": "sampleproject",
"sha256_digest": (
"117ed88e5db073bb92969a7545745fd977ee85b7019706dd256a64058f70963d"
),
"filetype": "sdist",
"metadata_version": "2.1",
"version": "3.0.0",
},
}
)
params.add("project-url", "https://example.com/foo")
params.add("project-url", "https://example.com/bar")

webtest.post(
"/legacy/?:action=file_upload",
headers={"Authorization": f"Basic {credentials}"},
params=params,
upload_files=[("content", "sampleproject-3.0.0.tar.gz", content)],
status=HTTPStatus.OK,
)
Expand Down

0 comments on commit b83a51a

Please sign in to comment.