Commit 0290c6f6 authored by qiongying.jia's avatar qiongying.jia
Browse files

TEST

parent 546b3c0b
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🎉 所有测试完成")
\ No newline at end of file
Supports Markdown
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