Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
37bc6295
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
10 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
37bc6295
编写于
10月 07, 2019
作者:
P
Pradyun Gedam
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename tests.lib.path.Path.{abspath -> resolve()}
上级
732da2da
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
15 deletion
+14
-15
tests/conftest.py
tests/conftest.py
+2
-2
tests/functional/test_install.py
tests/functional/test_install.py
+3
-3
tests/functional/test_install_reqs.py
tests/functional/test_install_reqs.py
+2
-2
tests/lib/__init__.py
tests/lib/__init__.py
+4
-4
tests/lib/path.py
tests/lib/path.py
+1
-2
tests/unit/test_req.py
tests/unit/test_req.py
+1
-1
tests/unit/test_req_file.py
tests/unit/test_req_file.py
+1
-1
未找到文件。
tests/conftest.py
浏览文件 @
37bc6295
...
...
@@ -190,7 +190,7 @@ def pip_src(tmpdir_factory):
# Copy over our source tree so that each use is self contained
shutil
.
copytree
(
SRC_DIR
,
pip_src
.
abspath
,
pip_src
.
resolve
()
,
ignore
=
not_code_files_and_folders
,
)
return
pip_src
...
...
@@ -222,7 +222,7 @@ def wheel_install(tmpdir_factory, common_wheels):
def
install_egg_link
(
venv
,
project_name
,
egg_info_dir
):
with
open
(
venv
.
site
/
'easy-install.pth'
,
'a'
)
as
fp
:
fp
.
write
(
str
(
egg_info_dir
.
abspath
)
+
'
\n
'
)
fp
.
write
(
str
(
egg_info_dir
.
resolve
()
)
+
'
\n
'
)
with
open
(
venv
.
site
/
(
project_name
+
'.egg-link'
),
'w'
)
as
fp
:
fp
.
write
(
str
(
egg_info_dir
)
+
'
\n
.'
)
...
...
tests/functional/test_install.py
浏览文件 @
37bc6295
...
...
@@ -456,14 +456,14 @@ def test_hashed_install_success(script, data, tmpdir):
"""
file_url
=
path_to_url
(
(
data
.
packages
/
'simple-1.0.tar.gz'
).
abspath
)
(
data
.
packages
/
'simple-1.0.tar.gz'
).
resolve
()
)
with
requirements_file
(
'simple2==1.0 --hash=sha256:9336af72ca661e6336eb87bc7de3e8844d853e'
'3848c2b9bbd2e8bf01db88c2c7
\n
'
'{simple} --hash=sha256:393043e672415891885c9a2a0929b1af95fb866d6c'
'a016b42d2e6ce53619b653'
.
format
(
simple
=
file_url
),
tmpdir
)
as
reqs_file
:
script
.
pip_install_local
(
'-r'
,
reqs_file
.
abspath
,
expect_error
=
False
)
script
.
pip_install_local
(
'-r'
,
reqs_file
.
resolve
()
,
expect_error
=
False
)
def
test_hashed_install_failure
(
script
,
tmpdir
):
...
...
@@ -478,7 +478,7 @@ def test_hashed_install_failure(script, tmpdir):
'c7de3e8844d853e3848c2b9bbd2e8bf01db88c2c
\n
'
,
tmpdir
)
as
reqs_file
:
result
=
script
.
pip_install_local
(
'-r'
,
reqs_file
.
abspath
,
reqs_file
.
resolve
()
,
expect_error
=
True
)
assert
len
(
result
.
files_created
)
==
0
...
...
tests/functional/test_install_reqs.py
浏览文件 @
37bc6295
...
...
@@ -371,7 +371,7 @@ def test_double_install_spurious_hash_mismatch(
# Install a package (and build its wheel):
result
=
script
.
pip_install_local
(
'--find-links'
,
data
.
find_links
,
'-r'
,
reqs_file
.
abspath
,
expect_error
=
False
)
'-r'
,
reqs_file
.
resolve
()
,
expect_error
=
False
)
assert
'Successfully installed simple-1.0'
in
str
(
result
)
# Uninstall it:
...
...
@@ -381,7 +381,7 @@ def test_double_install_spurious_hash_mismatch(
# package should install happily.
result
=
script
.
pip_install_local
(
'--find-links'
,
data
.
find_links
,
'-r'
,
reqs_file
.
abspath
,
expect_error
=
False
)
'-r'
,
reqs_file
.
resolve
()
,
expect_error
=
False
)
assert
'Successfully installed simple-1.0'
in
str
(
result
)
...
...
tests/lib/__init__.py
浏览文件 @
37bc6295
...
...
@@ -28,8 +28,8 @@ if MYPY_CHECK_RUNNING:
from
pip._internal.models.target_python
import
TargetPython
DATA_DIR
=
Path
(
__file__
).
parent
.
parent
.
joinpath
(
"data"
).
abspath
SRC_DIR
=
Path
(
__file__
).
abspath
.
parent
.
parent
.
parent
DATA_DIR
=
Path
(
__file__
).
parent
.
parent
.
joinpath
(
"data"
).
resolve
()
SRC_DIR
=
Path
(
__file__
).
resolve
()
.
parent
.
parent
.
parent
pyversion
=
get_major_minor_version
()
pyversion_tuple
=
sys
.
version_info
...
...
@@ -65,7 +65,7 @@ def _test_path_to_file_url(path):
Args:
path: a tests.lib.path.Path object.
"""
return
'file://'
+
path
.
abspath
.
replace
(
'
\\
'
,
'/'
)
return
'file://'
+
path
.
resolve
()
.
replace
(
'
\\
'
,
'/'
)
def
create_file
(
path
,
contents
=
None
):
...
...
@@ -155,7 +155,7 @@ class TestData(object):
def
__init__
(
self
,
root
,
source
=
None
):
self
.
source
=
source
or
DATA_DIR
self
.
root
=
Path
(
root
).
abspath
self
.
root
=
Path
(
root
).
resolve
()
@
classmethod
def
copy
(
cls
,
root
):
...
...
tests/lib/path.py
浏览文件 @
37bc6295
...
...
@@ -107,8 +107,7 @@ class Path(_base):
"""
return
Path
(
os
.
path
.
splitext
(
self
)[
1
])
@
property
def
abspath
(
self
):
def
resolve
(
self
):
"""
'./a/bc.d' -> '/home/a/bc.d'
"""
...
...
tests/unit/test_req.py
浏览文件 @
37bc6295
...
...
@@ -270,7 +270,7 @@ class TestRequirementSet(object):
def
test_hash_mismatch
(
self
,
data
):
"""A hash mismatch should raise an error."""
file_url
=
path_to_url
(
(
data
.
packages
/
'simple-1.0.tar.gz'
).
abspath
)
(
data
.
packages
/
'simple-1.0.tar.gz'
).
resolve
()
)
reqset
=
RequirementSet
(
require_hashes
=
True
)
reqset
.
add_requirement
(
get_processed_req_from_line
(
'%s --hash=sha256:badbad'
%
file_url
,
lineno
=
1
,
...
...
tests/unit/test_req_file.py
浏览文件 @
37bc6295
...
...
@@ -677,7 +677,7 @@ class TestParseRequirements(object):
'''
.
format
(
global_option
=
global_option
,
install_option
=
install_option
)
with
requirements_file
(
content
,
tmpdir
)
as
reqs_file
:
req
=
next
(
parse_requirements
(
reqs_file
.
abspath
,
req
=
next
(
parse_requirements
(
reqs_file
.
resolve
()
,
finder
=
finder
,
options
=
options
,
session
=
session
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录