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
cf16c392
Unverified
Commit
cf16c392
authored
Mar 21, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
3c558566
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
19 deletions
+4
-19
tests/masonry/publishing/test_uploader.py
+4
-19
No files found.
tests/masonry/publishing/test_uploader.py
View file @
cf16c392
...
@@ -8,22 +8,7 @@ from poetry.poetry import Poetry
...
@@ -8,22 +8,7 @@ from poetry.poetry import Poetry
from
poetry.utils._compat
import
Path
from
poetry.utils._compat
import
Path
fixtures_dir
=
Path
(
__file__
)
.
parent
/
"fixtures"
fixtures_dir
=
Path
(
__file__
)
.
parent
.
parent
.
parent
/
"fixtures"
@pytest.fixture
(
autouse
=
True
)
def
setup
():
clear_samples_dist
()
yield
clear_samples_dist
()
def
clear_samples_dist
():
for
dist
in
fixtures_dir
.
glob
(
"**/dist"
):
if
dist
.
is_dir
():
shutil
.
rmtree
(
str
(
dist
))
def
project
(
name
):
def
project
(
name
):
...
@@ -32,7 +17,7 @@ def project(name):
...
@@ -32,7 +17,7 @@ def project(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
(
"
complete
"
)),
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"
)
...
@@ -42,7 +27,7 @@ def test_uploader_properly_handles_400_errors(http):
...
@@ -42,7 +27,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
(
"
complete
"
)),
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"
)
...
@@ -55,7 +40,7 @@ def test_uploader_registers_for_appropriate_400_errors(mocker, http):
...
@@ -55,7 +40,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
(
"
complete
"
)),
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