mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Rework test_show_with_files_from_legacy
It relied on a function that does not exist anymore.
This commit is contained in:
parent
64967c7907
commit
0060bfa7e3
|
@ -1,11 +1,17 @@
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import re
|
import re
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from pip import __version__
|
from pip import __version__
|
||||||
from pip._internal.commands.show import search_packages_info
|
from pip._internal.commands.show import search_packages_info
|
||||||
from pip._internal.utils.unpacking import untar_file
|
from pip._internal.utils.unpacking import untar_file
|
||||||
from tests.lib import PipTestEnvironment, TestData, create_test_package_with_setup
|
from tests.lib import (
|
||||||
|
PipTestEnvironment,
|
||||||
|
TestData,
|
||||||
|
create_test_package_with_setup,
|
||||||
|
pyversion,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_basic_show(script: PipTestEnvironment) -> None:
|
def test_basic_show(script: PipTestEnvironment) -> None:
|
||||||
|
@ -74,10 +80,19 @@ def test_show_with_files_from_legacy(
|
||||||
str(setuptools_record),
|
str(setuptools_record),
|
||||||
cwd=source_dir,
|
cwd=source_dir,
|
||||||
)
|
)
|
||||||
write_installed_files_from_setuptools_record(
|
# Emulate the installed-files.txt generation which previous pip version did
|
||||||
setuptools_record.read_text().splitlines(),
|
# after running setup.py install (write_installed_files_from_setuptools_record).
|
||||||
root=None,
|
egg_info_dir = script.site_packages_path / f"simple-1.0-py{pyversion}.egg-info"
|
||||||
req_description="simple==1.0",
|
egg_info_dir.joinpath("installed-files.txt").write_text(
|
||||||
|
textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
../simple/__init__.py
|
||||||
|
PKG-INFO
|
||||||
|
SOURCES.txt
|
||||||
|
dependency_links.txt
|
||||||
|
top_level.txt
|
||||||
|
"""
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
result = script.pip("show", "--files", "simple")
|
result = script.pip("show", "--files", "simple")
|
||||||
|
|
Loading…
Reference in a new issue