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
20b0a490
Commit
20b0a490
authored
Mar 22, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: improve install command group opt coverage
parent
c83bb94c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
tests/console/commands/test_install.py
+19
-3
No files found.
tests/console/commands/test_install.py
View file @
20b0a490
...
@@ -40,6 +40,9 @@ baz = "^1.2"
...
@@ -40,6 +40,9 @@ baz = "^1.2"
[tool.poetry.group.bim.dependencies]
[tool.poetry.group.bim.dependencies]
bim = "^1.3"
bim = "^1.3"
[tool.poetry.group.bam]
optional = true
[tool.poetry.group.bam.dependencies]
[tool.poetry.group.bam.dependencies]
bam = "^1.4"
bam = "^1.4"
"""
"""
...
@@ -57,21 +60,34 @@ def tester(
...
@@ -57,21 +60,34 @@ def tester(
return
command_tester_factory
(
"install"
)
return
command_tester_factory
(
"install"
)
@pytest.mark.parametrize
(
(
"options"
,
"groups"
),
[
(
""
,
{
"default"
,
"foo"
,
"bar"
,
"baz"
,
"bim"
}),
(
"--only default"
,
{
"default"
}),
(
"--only foo"
,
{
"foo"
}),
(
"--only foo,bar"
,
{
"foo"
,
"bar"
}),
(
"--only bam"
,
{
"bam"
}),
(
"--with bam"
,
{
"default"
,
"foo"
,
"bar"
,
"baz"
,
"bim"
,
"bam"
}),
(
"--without foo,bar"
,
{
"default"
,
"baz"
,
"bim"
}),
(
"--with foo,bar --without baz --without bim --only bam"
,
{
"bam"
}),
],
)
def
test_group_options_are_passed_to_the_installer
(
def
test_group_options_are_passed_to_the_installer
(
tester
:
CommandTester
,
mocker
:
MockerFixture
options
:
str
,
groups
:
set
[
str
],
tester
:
CommandTester
,
mocker
:
MockerFixture
):
):
"""
"""
Group options are passed properly to the installer.
Group options are passed properly to the installer.
"""
"""
mocker
.
patch
.
object
(
tester
.
command
.
installer
,
"run"
,
return_value
=
1
)
mocker
.
patch
.
object
(
tester
.
command
.
installer
,
"run"
,
return_value
=
1
)
tester
.
execute
(
"--with foo,bar --without baz --without bim --only bam"
)
tester
.
execute
(
options
)
package_groups
=
set
(
tester
.
command
.
poetry
.
package
.
_dependency_groups
.
keys
())
package_groups
=
set
(
tester
.
command
.
poetry
.
package
.
_dependency_groups
.
keys
())
installer_groups
=
set
(
tester
.
command
.
installer
.
_groups
)
installer_groups
=
set
(
tester
.
command
.
installer
.
_groups
)
assert
installer_groups
<=
package_groups
assert
installer_groups
<=
package_groups
assert
set
(
installer_groups
)
==
{
"bam"
}
assert
set
(
installer_groups
)
==
groups
def
test_sync_option_is_passed_to_the_installer
(
def
test_sync_option_is_passed_to_the_installer
(
...
...
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