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
d8c05c37
Commit
d8c05c37
authored
Sep 16, 2022
by
Randy Döring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cache clear): normalize package name
parent
20352b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
src/poetry/console/commands/cache/clear.py
+2
-1
tests/console/commands/cache/test_clear.py
+5
-1
No files found.
src/poetry/console/commands/cache/clear.py
View file @
d8c05c37
...
...
@@ -4,6 +4,7 @@ import os
from
cleo.helpers
import
argument
from
cleo.helpers
import
option
from
packaging.utils
import
canonicalize_name
from
poetry.config.config
import
Config
from
poetry.console.commands.command
import
Command
...
...
@@ -66,7 +67,7 @@ class CacheClearCommand(Command):
"Add a specific version to clear"
)
elif
len
(
parts
)
==
3
:
package
=
parts
[
1
]
package
=
canonicalize_name
(
parts
[
1
])
version
=
parts
[
2
]
if
not
cache
.
has
(
f
"{package}:{version}"
):
...
...
tests/console/commands/cache/test_clear.py
View file @
d8c05c37
...
...
@@ -55,12 +55,16 @@ def test_cache_clear_all_no(
assert
cache
.
has
(
"cleo:0.2"
)
@pytest.mark.parametrize
(
"package_name"
,
[
"cachy"
,
"Cachy"
])
def
test_cache_clear_pkg
(
tester
:
ApplicationTester
,
repository_one
:
str
,
cache
:
CacheManager
,
package_name
:
str
,
):
exit_code
=
tester
.
execute
(
f
"cache clear {repository_one}:cachy:0.1"
,
inputs
=
"yes"
)
exit_code
=
tester
.
execute
(
f
"cache clear {repository_one}:{package_name}:0.1"
,
inputs
=
"yes"
)
assert
exit_code
==
0
assert
tester
.
io
.
fetch_output
()
==
""
...
...
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