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
50190c36
Unverified
Commit
50190c36
authored
Oct 13, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for Python 2.7
parent
c70edfd7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
tests/console/commands/test_check.py
+8
-0
tests/test_poetry.py
+12
-8
No files found.
tests/console/commands/test_check.py
View file @
50190c36
from
cleo.testers
import
CommandTester
from
cleo.testers
import
CommandTester
from
poetry.utils._compat
import
PY2
from
poetry.utils._compat
import
Path
from
poetry.utils._compat
import
Path
from
poetry.poetry
import
Poetry
from
poetry.poetry
import
Poetry
...
@@ -26,6 +27,13 @@ def test_check_invalid(app):
...
@@ -26,6 +27,13 @@ def test_check_invalid(app):
tester
.
execute
([(
"command"
,
command
.
get_name
())])
tester
.
execute
([(
"command"
,
command
.
get_name
())])
if
PY2
:
expected
=
"""
\
Error: u'description' is a required property
Error: INVALID is not a valid license
Warning: A wildcard Python dependency is ambiguous. Consider specifying a more explicit one.
"""
else
:
expected
=
"""
\
expected
=
"""
\
Error: 'description' is a required property
Error: 'description' is a required property
Error: INVALID is not a valid license
Error: INVALID is not a valid license
...
...
tests/test_poetry.py
View file @
50190c36
...
@@ -2,10 +2,8 @@
...
@@ -2,10 +2,8 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
pytest
from
poetry.exceptions
import
InvalidProjectFile
from
poetry.poetry
import
Poetry
from
poetry.poetry
import
Poetry
from
poetry.utils._compat
import
PY2
from
poetry.utils._compat
import
Path
from
poetry.utils._compat
import
Path
from
poetry.utils.toml_file
import
TomlFile
from
poetry.utils.toml_file
import
TomlFile
...
@@ -145,10 +143,16 @@ def test_check_fails():
...
@@ -145,10 +143,16 @@ def test_check_fails():
complete
=
TomlFile
(
fixtures_dir
/
"complete.toml"
)
complete
=
TomlFile
(
fixtures_dir
/
"complete.toml"
)
content
=
complete
.
read
()[
"tool"
][
"poetry"
]
content
=
complete
.
read
()[
"tool"
][
"poetry"
]
content
[
"this key is not in the schema"
]
=
""
content
[
"this key is not in the schema"
]
=
""
assert
Poetry
.
check
(
content
)
==
{
"errors"
:
[
if
PY2
:
expected
=
(
"Additional properties are not allowed "
"(u'this key is not in the schema' was unexpected)"
)
else
:
expected
=
(
"Additional properties are not allowed "
"Additional properties are not allowed "
"('this key is not in the schema' was unexpected)"
"('this key is not in the schema' was unexpected)"
],
)
"warnings"
:
[],
}
assert
Poetry
.
check
(
content
)
==
{
"errors"
:
[
expected
],
"warnings"
:
[]
}
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