Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zheng Gaoshan
co-devTest
Commits
e601304a
Commit
e601304a
authored
May 20, 2025
by
qiongying.jia
Browse files
testdocker
parent
dc584249
Changes
4
Hide whitespace changes
Inline
Side-by-side
__pycache__/codesp.cpython-311.pyc
0 → 100644
View file @
e601304a
File added
a.py
deleted
100644 → 0
View file @
dc584249
#this is test message
#another
try
:
import
jinja2
template
=
jinja2
.
Template
(
"Hello {{ name }}!"
)
assert
template
.
render
(
name
=
"World"
)
==
"Hello World!"
print
(
"✅ Jinja2 模板渲染测试通过"
)
except
Exception
as
e
:
print
(
"❌ Jinja2 测试失败:"
,
e
)
try
:
import
jsonschema
from
jsonschema
import
validate
schema
=
{
"type"
:
"object"
,
"required"
:
[
"name"
],
"properties"
:
{
"name"
:
{
"type"
:
"string"
}}}
instance
=
{
"name"
:
"test"
}
validate
(
instance
=
instance
,
schema
=
schema
)
print
(
"✅ jsonschema 验证测试通过"
)
except
Exception
as
e
:
print
(
"❌ jsonschema 测试失败:"
,
e
)
try
:
import
numpy
a
=
numpy
.
array
([
1
,
2
,
3
])
assert
len
(
a
)
==
3
print
(
"✅ Numpy 数组测试通过"
)
except
Exception
as
e
:
print
(
"❌ Numpy 测试失败:"
,
e
)
try
:
import
pandas
df
=
pandas
.
DataFrame
({
"col"
:
[
1
,
2
,
3
]})
assert
len
(
df
)
==
3
print
(
"✅ Pandas DataFrame 测试通过"
)
except
Exception
as
e
:
print
(
"❌ Pandas 测试失败:"
,
e
)
try
:
import
loguru
from
loguru
import
logger
logger
.
add
(
"test.log"
)
logger
.
info
(
"Test log message"
)
with
open
(
"test.log"
,
"r"
)
as
f
:
content
=
f
.
read
()
assert
"Test log message"
in
content
print
(
"✅ Loguru 日志测试通过"
)
except
Exception
as
e
:
print
(
"❌ Loguru 测试失败:"
,
e
)
print
(
"
\n
🎉 所有测试完成"
)
codesp.py
0 → 100644
View file @
e601304a
import
jinja2
#this is test message
#another
def
test
():
try
:
template
=
jinja2
.
Template
(
"Hello {{ name }}!"
)
assert
template
.
render
(
name
=
"World"
)
==
"Hello World!"
print
(
"✅ Jinja2 模板渲染测试通过"
)
except
Exception
as
e
:
print
(
"❌ Jinja2 测试失败:"
,
e
)
# try:
# import jsonschema
# from jsonschema import validate
# schema = {"type": "object", "required": ["name"], "properties": {"name": {"type": "string"}}}
# instance = {"name": "test"}
# validate(instance=instance, schema=schema)
# print("✅ jsonschema 验证测试通过")
# except Exception as e:
# print("❌ jsonschema 测试失败:", e)
# try:
# import numpy
# a = numpy.array([1, 2, 3])
# assert len(a) == 3
# print("✅ Numpy 数组测试通过")
# except Exception as e:
# print("❌ Numpy 测试失败:", e)
# try:
# import pandas
# df = pandas.DataFrame({"col": [1, 2, 3]})
# assert len(df) == 3
# print("✅ Pandas DataFrame 测试通过")
# except Exception as e:
# print("❌ Pandas 测试失败:", e)
# try:
# import loguru
# from loguru import logger
# logger.add("test.log")
# logger.info("Test log message")
# with open("test.log", "r") as f:
# content = f.read()
# assert "Test log message" in content
# print("✅ Loguru 日志测试通过")
# except Exception as e:
# print("❌ Loguru 测试失败:", e)
# print("\n🎉 所有测试完成")
run.py
View file @
e601304a
import
os
import
shutil
from
codesp
import
test
####5-19-3
def
main
():
test
()
# 定义初始路径和目标路径
source_dir
=
'/workspace/input/'
target_dir
=
'/workspace/output/'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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