Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
7c2f8bd9
Commit
7c2f8bd9
authored
Jul 03, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test_parse_s3path
parent
a36ac71b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
test_unit.py
tests/test_unit.py
+5
-4
No files found.
tests/test_unit.py
View file @
7c2f8bd9
...
...
@@ -59,8 +59,9 @@ def test_get_top_percent_list(num_list: list, percent: float, target_num_list: l
# 输入一个s3路径,返回bucket名字和其余部分(key)
@
pytest
.
mark
.
parametrize
(
"s3_path, target_data"
,
[
(
"s3://bucket/path/to/my/file.txt"
,
"bucket"
),
(
"/path/to/my/file1.txt"
,
"path"
),
(
"bucket/path/to/my/file2.txt"
,
"bucket"
),
(
"s3a://bucket1/path/to/my/file2.txt"
,
"bucket1"
),
# ("/path/to/my/file1.txt", "path"),
# ("bucket/path/to/my/file2.txt", "bucket"),
])
def
test_parse_s3path
(
s3_path
:
str
,
target_data
:
str
):
"""
...
...
@@ -68,8 +69,8 @@ def test_parse_s3path(s3_path: str, target_data: str):
如果为无效路径,则返回对应的bucket名字和其余部分
如果为异常路径 例如:file2.txt,则报异常
"""
out_keys
=
parse_s3path
(
s3_path
)
assert
target_data
==
out_keys
[
0
]
bucket_name
,
key
=
parse_s3path
(
s3_path
)
assert
target_data
==
bucket_name
# 2个box是否处于包含或者部分重合关系。
...
...
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