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
80ca01bd
Commit
80ca01bd
authored
Apr 29, 2024
by
quyuan
Browse files
add cli test
parent
d61cb493
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
tests/test_cli/conf/conf.py
tests/test_cli/conf/conf.py
+1
-1
tests/test_cli/lib/common.py
tests/test_cli/lib/common.py
+9
-3
No files found.
tests/test_cli/conf/conf.py
View file @
80ca01bd
...
@@ -2,7 +2,7 @@ import os
...
@@ -2,7 +2,7 @@ import os
conf
=
{
conf
=
{
"code_path"
:
os
.
environ
.
get
(
'GITHUB_WORKSPACE'
),
"code_path"
:
os
.
environ
.
get
(
'GITHUB_WORKSPACE'
),
"pdf_dev_path"
:
os
.
environ
.
get
(
'GITHUB_WORKSPACE'
)
+
"/tests/test_cli/pdf_dev"
,
"pdf_dev_path"
:
os
.
environ
.
get
(
'GITHUB_WORKSPACE'
)
+
"/tests/test_cli/pdf_dev"
,
"pdf_res_path"
:
"/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/
data
"
"pdf_res_path"
:
"/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/
ci
"
}
}
tests/test_cli/lib/common.py
View file @
80ca01bd
...
@@ -11,8 +11,14 @@ def count_folders_and_check_contents(directory):
...
@@ -11,8 +11,14 @@ def count_folders_and_check_contents(directory):
for
item
in
contents
:
for
item
in
contents
:
# 检查是否为文件夹
# 检查是否为文件夹
if
os
.
path
.
isdir
(
os
.
path
.
join
(
directory
,
item
)):
if
os
.
path
.
isdir
(
os
.
path
.
join
(
directory
,
item
)):
folder_count
+=
1
# 检查文件夹是否为空
# 检查文件夹是否为空
folder_path
=
os
.
path
.
join
(
directory
,
item
)
folder_path
=
os
.
path
.
join
(
directory
,
item
)
for
folder
in
os
.
listdir
(
folder_path
):
folder_count
=
folder_count
+
1
assert
os
.
listdir
(
folder_path
)
is
not
None
assert
os
.
listdir
(
folder_path
)
is
not
None
assert
folder_count
==
3
print
(
folder_count
)
assert
folder_count
==
13
if
__name__
==
"__main__"
:
count_folders_and_check_contents
(
"/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/ci"
)
\ No newline at end of file
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