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
77b661a9
Commit
77b661a9
authored
Nov 07, 2018
by
Paul Ganssle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for HTTPError in upload_file
parent
74177400
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
setuptools/tests/test_upload.py
setuptools/tests/test_upload.py
+20
-0
No files found.
setuptools/tests/test_upload.py
View file @
77b661a9
...
...
@@ -3,6 +3,7 @@ import os
import
re
from
distutils
import
log
from
distutils.errors
import
DistutilsError
from
distutils.version
import
StrictVersion
import
pytest
...
...
@@ -146,3 +147,22 @@ class TestUploadTest:
with
pytest
.
raises
(
AssertionError
):
cmd
.
run
()
def
test_upload_file_http_error
(
self
,
patched_upload
):
patched_upload
.
urlopen
.
side_effect
=
six
.
moves
.
urllib
.
error
.
HTTPError
(
'https://example.com'
,
404
,
'File not found'
,
None
,
None
)
cmd
=
patched_upload
.
cmd
cmd
.
ensure_finalized
()
with
pytest
.
raises
(
DistutilsError
):
cmd
.
run
()
cmd
.
announce
.
assert_any_call
(
'Upload failed (404): File not found'
,
log
.
ERROR
)
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