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
a9ac06f8
Unverified
Commit
a9ac06f8
authored
Jun 05, 2023
by
Riccardo Albertazzi
Committed by
GitHub
Jun 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: check that invalid package names are filtered out (#7980)
parent
e1344efd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
tests/repositories/fixtures/legacy/pytest-with-extra-packages.html
+23
-0
tests/repositories/test_legacy_repository.py
+24
-0
No files found.
tests/repositories/fixtures/legacy/pytest-with-extra-packages.html
0 → 100644
View file @
a9ac06f8
<!DOCTYPE html>
<html>
<head>
<title>
Links for pytest
</title>
</head>
<body>
<h1>
Links for pytest
</h1>
<a
href=
"https://files.pythonhosted.org/packages/ed/96/271c93f75212c06e2a7ec3e2fa8a9c90acee0a4838dc05bf379ea09aae31/pytest-3.5.0-py2.py3-none-any.whl#sha256=6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c"
data-requires-python=
">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
>
pytest-3.5.0-py2.py3-none-any.whl
</a><br
/>
<a
href=
"https://files.pythonhosted.org/packages/2d/56/6019153cdd743300c5688ab3b07702355283e53c83fbf922242c053ffb7b/pytest-3.5.0.tar.gz#sha256=fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1"
data-requires-python=
">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
>
pytest-3.5.0.tar.gz
</a><br
/>
<a
href=
"https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl#sha256=ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1"
data-requires-python=
">=2.6, <3"
>
futures-3.2.0-py2-none-any.whl
</a><br
/>
<a
href=
"https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl#sha256=ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1"
data-requires-python=
">=2.6, <3"
>
pytest-3.10.0-py2.py3-none-any.whl
</a><br
/>
<a
href=
"https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl#sha256=ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1"
data-requires-python=
">=2.6, <3"
>
pytest-3.5.0-py2.py3-none-any.whl
</a><br
/>
</body>
</html>
<!--SERIAL 7198641-->
tests/repositories/test_legacy_repository.py
View file @
a9ac06f8
...
...
@@ -115,6 +115,30 @@ def test_page_invalid_version_link() -> None:
assert
packages
[
0
]
.
version
.
to_string
()
==
"0.1.0"
def
test_page_filters_out_invalid_package_names
()
->
None
:
class
SpecialMockRepository
(
MockRepository
):
def
_get_page
(
self
,
name
:
NormalizedName
)
->
SimpleRepositoryPage
:
return
super
()
.
_get_page
(
canonicalize_name
(
f
"{name}-with-extra-packages"
))
repo
=
SpecialMockRepository
()
packages
=
repo
.
find_packages
(
Factory
.
create_dependency
(
"pytest"
,
"*"
))
assert
len
(
packages
)
==
1
assert
packages
[
0
]
.
name
==
"pytest"
assert
packages
[
0
]
.
version
==
Version
.
parse
(
"3.5.0"
)
package
=
repo
.
package
(
"pytest"
,
Version
.
parse
(
"3.5.0"
))
assert
package
.
files
==
[
{
"file"
:
"pytest-3.5.0-py2.py3-none-any.whl"
,
"hash"
:
"sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c"
,
# noqa: E501
},
{
"file"
:
"pytest-3.5.0.tar.gz"
,
"hash"
:
"sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1"
,
# noqa: E501
},
]
def
test_sdist_format_support
()
->
None
:
repo
=
MockRepository
()
page
=
repo
.
get_page
(
"relative"
)
...
...
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