Commit 11e99825 authored by quyuan's avatar quyuan

Merge branch 'master' of https://github.com/opendatalab/MinerU

parents 11827a89 1d3d63ab
...@@ -59,8 +59,9 @@ def test_get_top_percent_list(num_list: list, percent: float, target_num_list: l ...@@ -59,8 +59,9 @@ def test_get_top_percent_list(num_list: list, percent: float, target_num_list: l
# 输入一个s3路径,返回bucket名字和其余部分(key) # 输入一个s3路径,返回bucket名字和其余部分(key)
@pytest.mark.parametrize("s3_path, target_data", [ @pytest.mark.parametrize("s3_path, target_data", [
("s3://bucket/path/to/my/file.txt", "bucket"), ("s3://bucket/path/to/my/file.txt", "bucket"),
("/path/to/my/file1.txt", "path"), ("s3a://bucket1/path/to/my/file2.txt", "bucket1"),
("bucket/path/to/my/file2.txt", "bucket"), # ("/path/to/my/file1.txt", "path"),
# ("bucket/path/to/my/file2.txt", "bucket"),
]) ])
def test_parse_s3path(s3_path: str, target_data: str): def test_parse_s3path(s3_path: str, target_data: str):
""" """
...@@ -68,8 +69,8 @@ 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名字和其余部分 如果为无效路径,则返回对应的bucket名字和其余部分
如果为异常路径 例如:file2.txt,则报异常 如果为异常路径 例如:file2.txt,则报异常
""" """
out_keys = parse_s3path(s3_path) bucket_name, key = parse_s3path(s3_path)
assert target_data == out_keys[0] assert target_data == bucket_name
# 2个box是否处于包含或者部分重合关系。 # 2个box是否处于包含或者部分重合关系。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment