Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
74177400
Commit
74177400
authored
Nov 07, 2018
by
Paul Ganssle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for invalid URLs in upload_file
parent
f4458afd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
setuptools/tests/test_upload.py
setuptools/tests/test_upload.py
+18
-1
No files found.
setuptools/tests/test_upload.py
View file @
74177400
...
...
@@ -95,7 +95,6 @@ class TestUploadTest:
entries
=
patched_upload
.
get_uploaded_metadata
()
assert
entries
[
'metadata_version'
]
==
'2.1'
def
test_warns_deprecation
(
self
):
dist
=
Distribution
()
dist
.
dist_files
=
[(
mock
.
Mock
(),
mock
.
Mock
(),
mock
.
Mock
())]
...
...
@@ -129,3 +128,21 @@ class TestUploadTest:
"upload instead (https://pypi.org/p/twine/)"
,
log
.
WARN
)
@
pytest
.
mark
.
parametrize
(
'url'
,
[
'https://example.com/a;parameter'
,
# Has parameters
'https://example.com/a?query'
,
# Has query
'https://example.com/a#fragment'
,
# Has fragment
'ftp://example.com'
,
# Invalid scheme
])
def
test_upload_file_invalid_url
(
self
,
url
,
patched_upload
):
patched_upload
.
urlopen
.
side_effect
=
Exception
(
"Should not be reached"
)
cmd
=
patched_upload
.
cmd
cmd
.
repository
=
url
cmd
.
ensure_finalized
()
with
pytest
.
raises
(
AssertionError
):
cmd
.
run
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment