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
907d31ae
Commit
907d31ae
authored
May 16, 2024
by
renpengli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add base unittest s3
parent
4cc005f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
test_unit.py
tests/test_unit.py
+9
-1
No files found.
tests/test_unit.py
View file @
907d31ae
...
@@ -7,6 +7,7 @@ from magic_pdf.libs.boxbase import _is_in_or_part_overlap, _is_in_or_part_overla
...
@@ -7,6 +7,7 @@ from magic_pdf.libs.boxbase import _is_in_or_part_overlap, _is_in_or_part_overla
find_top_nearest_text_bbox
,
find_bottom_nearest_text_bbox
,
find_left_nearest_text_bbox
,
\
find_top_nearest_text_bbox
,
find_bottom_nearest_text_bbox
,
find_left_nearest_text_bbox
,
\
find_right_nearest_text_bbox
,
bbox_relative_pos
,
bbox_distance
find_right_nearest_text_bbox
,
bbox_relative_pos
,
bbox_distance
from
magic_pdf.libs.commons
import
mymax
,
join_path
,
get_top_percent_list
from
magic_pdf.libs.commons
import
mymax
,
join_path
,
get_top_percent_list
from
magic_pdf.libs.config_reader
import
get_s3_config
from
magic_pdf.libs.path_utils
import
parse_s3path
from
magic_pdf.libs.path_utils
import
parse_s3path
...
@@ -512,4 +513,11 @@ def test_bbox_relative_pos(box1: tuple, box2: tuple, target_box: tuple) -> None:
...
@@ -512,4 +513,11 @@ def test_bbox_relative_pos(box1: tuple, box2: tuple, target_box: tuple) -> None:
def
test_bbox_distance
(
box1
:
tuple
,
box2
:
tuple
,
target_num
:
float
)
->
None
:
def
test_bbox_distance
(
box1
:
tuple
,
box2
:
tuple
,
target_num
:
float
)
->
None
:
assert
target_num
-
bbox_distance
(
box1
,
box2
)
<
1
assert
target_num
-
bbox_distance
(
box1
,
box2
)
<
1
# 根据bucket_name获取s3配置ak,sk,endpoint
def
test_get_s3_config
()
->
None
:
with
open
(
"./s3_config_testdata.json"
)
as
f
:
contents
=
f
.
read
()
for
content
in
eval
(
contents
):
bucket_name
=
content
[
"bucket_name"
]
target_data
=
content
[
"target_data"
]
assert
target_data
==
list
(
get_s3_config
(
bucket_name
))
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