Commit e601304a authored by qiongying.jia's avatar qiongying.jia
Browse files

testdocker

parent dc584249
Loading
Loading
Loading
Loading
+806 B

File added.

No diff preview for this file type.

a.py

deleted100644 → 0
+0 −49
Original line number Diff line number Diff line
#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
+51 −0
Original line number Diff line number Diff line
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🎉 所有测试完成")
+3 −2
Original line number Diff line number Diff line
import os
import shutil
from codesp import test


####5-19-3


def main():


    test()
    # 定义初始路径和目标路径
    source_dir = '/workspace/input/'
    target_dir = '/workspace/output/'