Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
c0d6d7bc
Unverified
Commit
c0d6d7bc
authored
Mar 21, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
cf16c392
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
tests/masonry/publishing/test_uploader.py
+4
-5
No files found.
tests/masonry/publishing/test_uploader.py
View file @
c0d6d7bc
import
pytest
import
pytest
import
shutil
from
poetry.masonry.publishing.uploader
import
UploadError
from
poetry.masonry.publishing.uploader
import
UploadError
from
poetry.masonry.publishing.uploader
import
Uploader
from
poetry.masonry.publishing.uploader
import
Uploader
...
@@ -12,12 +11,12 @@ fixtures_dir = Path(__file__).parent.parent.parent / "fixtures"
...
@@ -12,12 +11,12 @@ fixtures_dir = Path(__file__).parent.parent.parent / "fixtures"
def
project
(
name
):
def
project
(
name
):
return
Path
(
__file__
)
.
parent
/
"fixtures"
/
name
return
fixtures_dir
/
name
def
test_uploader_properly_handles_400_errors
(
http
):
def
test_uploader_properly_handles_400_errors
(
http
):
http
.
register_uri
(
http
.
POST
,
"https://foo.com"
,
status
=
400
,
body
=
"Bad request"
)
http
.
register_uri
(
http
.
POST
,
"https://foo.com"
,
status
=
400
,
body
=
"Bad request"
)
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
-
project"
)),
NullIO
())
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
_
project"
)),
NullIO
())
with
pytest
.
raises
(
UploadError
)
as
e
:
with
pytest
.
raises
(
UploadError
)
as
e
:
uploader
.
upload
(
"https://foo.com"
)
uploader
.
upload
(
"https://foo.com"
)
...
@@ -27,7 +26,7 @@ def test_uploader_properly_handles_400_errors(http):
...
@@ -27,7 +26,7 @@ def test_uploader_properly_handles_400_errors(http):
def
test_uploader_properly_handles_403_errors
(
http
):
def
test_uploader_properly_handles_403_errors
(
http
):
http
.
register_uri
(
http
.
POST
,
"https://foo.com"
,
status
=
403
,
body
=
"Unauthorized"
)
http
.
register_uri
(
http
.
POST
,
"https://foo.com"
,
status
=
403
,
body
=
"Unauthorized"
)
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
-
project"
)),
NullIO
())
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
_
project"
)),
NullIO
())
with
pytest
.
raises
(
UploadError
)
as
e
:
with
pytest
.
raises
(
UploadError
)
as
e
:
uploader
.
upload
(
"https://foo.com"
)
uploader
.
upload
(
"https://foo.com"
)
...
@@ -40,7 +39,7 @@ def test_uploader_registers_for_appropriate_400_errors(mocker, http):
...
@@ -40,7 +39,7 @@ def test_uploader_registers_for_appropriate_400_errors(mocker, http):
http
.
register_uri
(
http
.
register_uri
(
http
.
POST
,
"https://foo.com"
,
status
=
400
,
body
=
"No package was ever registered"
http
.
POST
,
"https://foo.com"
,
status
=
400
,
body
=
"No package was ever registered"
)
)
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
-
project"
)),
NullIO
())
uploader
=
Uploader
(
Poetry
.
create
(
project
(
"simple
_
project"
)),
NullIO
())
with
pytest
.
raises
(
UploadError
):
with
pytest
.
raises
(
UploadError
):
uploader
.
upload
(
"https://foo.com"
)
uploader
.
upload
(
"https://foo.com"
)
...
...
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