Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
3492744c
Unverified
Commit
3492744c
authored
Apr 17, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Apr 17, 2025
Browse files
Merge pull request #2269 from dt-yy/dev
update test case
parents
74f9978e
a1fe3702
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
41 deletions
+7
-41
tests/test_cli/test_cli_sdk.py
tests/test_cli/test_cli_sdk.py
+7
-41
No files found.
tests/test_cli/test_cli_sdk.py
View file @
3492744c
...
...
@@ -323,44 +323,6 @@ class TestCli:
logging
.
info
(
cmd
)
os
.
system
(
cmd
)
@
pytest
.
mark
.
P1
def
test_local_magic_pdf_open_st_table
(
self
):
"""magic pdf cli open st table."""
time
.
sleep
(
2
)
#pre_cmd = "cp ~/magic_pdf_st.json ~/magic-pdf.json"
value
=
{
"model"
:
"struct_eqtable"
,
"enable"
:
True
,
"max_time"
:
400
}
common
.
update_config_file
(
magic_pdf_config
,
"table-config"
,
value
)
pdf_path
=
os
.
path
.
join
(
pdf_dev_path
,
"pdf"
,
"test_rearch_report.pdf"
)
common
.
delete_file
(
pdf_res_path
)
cli_cmd
=
"magic-pdf -p %s -o %s"
%
(
pdf_path
,
pdf_res_path
)
os
.
system
(
cli_cmd
)
res
=
common
.
check_html_table_exists
(
os
.
path
.
join
(
pdf_res_path
,
"test_rearch_report"
,
"auto"
,
"test_rearch_report.md"
))
assert
res
is
True
@
pytest
.
mark
.
P1
def
test_local_magic_pdf_open_tablemaster_cuda
(
self
):
"""magic pdf cli open table master html table cuda mode."""
time
.
sleep
(
2
)
#pre_cmd = "cp ~/magic_pdf_html.json ~/magic-pdf.json"
#os.system(pre_cmd)
value
=
{
"model"
:
"tablemaster"
,
"enable"
:
True
,
"max_time"
:
400
}
common
.
update_config_file
(
magic_pdf_config
,
"table-config"
,
value
)
pdf_path
=
os
.
path
.
join
(
pdf_dev_path
,
"pdf"
,
"test_rearch_report.pdf"
)
common
.
delete_file
(
pdf_res_path
)
cli_cmd
=
"magic-pdf -p %s -o %s"
%
(
pdf_path
,
pdf_res_path
)
os
.
system
(
cli_cmd
)
res
=
common
.
check_html_table_exists
(
os
.
path
.
join
(
pdf_res_path
,
"test_rearch_report"
,
"auto"
,
"test_rearch_report.md"
))
assert
res
is
True
@
pytest
.
mark
.
P1
def
test_local_magic_pdf_open_rapidai_table
(
self
):
"""magic pdf cli open rapid ai table."""
...
...
@@ -370,6 +332,7 @@ class TestCli:
value
=
{
"model"
:
"rapid_table"
,
"enable"
:
True
,
"sub_model"
:
"slanet_plus"
,
"max_time"
:
400
}
common
.
update_config_file
(
magic_pdf_config
,
"table-config"
,
value
)
...
...
@@ -397,6 +360,7 @@ class TestCli:
os
.
system
(
cli_cmd
)
common
.
cli_count_folders_and_check_contents
(
os
.
path
.
join
(
pdf_res_path
,
"test_rearch_report"
,
"auto"
))
@
pytest
.
mark
.
skip
(
reason
=
"layoutlmv3废弃"
)
@
pytest
.
mark
.
P1
def
test_local_magic_pdf_layoutlmv3_yolo
(
self
):
"""magic pdf cli open layoutlmv3."""
...
...
@@ -419,8 +383,9 @@ class TestCli:
#pre_cmd = "cp ~/magic_pdf_html_table_cpu.json ~/magic-pdf.json"
#os.system(pre_cmd)
value
=
{
"model"
:
"tablemaster"
,
"enable"
:
False
,
"model"
:
"rapid_table"
,
"enable"
:
True
,
"sub_model"
:
"slanet_plus"
,
"max_time"
:
400
}
common
.
update_config_file
(
magic_pdf_config
,
"table-config"
,
value
)
...
...
@@ -439,8 +404,9 @@ class TestCli:
#pre_cmd = "cp ~/magic_pdf_close_table.json ~/magic-pdf.json"
#os.system(pre_cmd)
value
=
{
"model"
:
"
tablemaster
"
,
"model"
:
"
rapid_table
"
,
"enable"
:
False
,
"sub_model"
:
"slanet_plus"
,
"max_time"
:
400
}
common
.
update_config_file
(
magic_pdf_config
,
"table-config"
,
value
)
...
...
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