调整版本并做测试

This commit is contained in:
2026-02-27 17:10:54 +08:00
parent fa673138f6
commit 31be9d0e97
77 changed files with 679 additions and 25 deletions

14
test.py
View File

@@ -16,7 +16,7 @@ def test_kit_classes():
print("Testing kit classes...")
# Test StrKit
from py_enjoy.kit.StrKit import StrKit
from pyenjoy.kit.StrKit import StrKit
assert StrKit.first_char_to_lower_case("Hello") == "hello"
assert StrKit.first_char_to_upper_case("hello") == "Hello"
assert StrKit.is_blank(" ") == True
@@ -25,7 +25,7 @@ def test_kit_classes():
print("✓ StrKit tests passed")
# Test HashKit
from py_enjoy.kit.HashKit import HashKit
from pyenjoy.kit.HashKit import HashKit
md5_result = HashKit.md5("test")
assert len(md5_result) == 32
assert HashKit.slow_equals(b"test", b"test") == True
@@ -33,7 +33,7 @@ def test_kit_classes():
print("✓ HashKit tests passed")
# Test Kv
from py_enjoy.kit.Kv import Kv
from pyenjoy.kit.Kv import Kv
kv = Kv.of("name", "John").set("age", 25)
assert kv.get("name") == "John"
assert kv.get_int("age") == 25
@@ -41,7 +41,7 @@ def test_kit_classes():
print("✓ Kv tests passed")
# Test Prop
from py_enjoy.kit.Prop import Prop
from pyenjoy.kit.Prop import Prop
# Create a test properties file
test_content = """
name=John
@@ -61,8 +61,8 @@ def test_template_engine():
"""Test template engine"""
print("\nTesting template engine...")
from py_enjoy.template.Engine import Engine
from py_enjoy.kit.Kv import Kv
from pyenjoy.template.Engine import Engine
from pyenjoy.kit.Kv import Kv
engine = Engine.use()
@@ -85,7 +85,7 @@ def test_type_conversions():
"""Test type conversions"""
print("\nTesting type conversions...")
from py_enjoy.kit.TypeKit import TypeKit
from pyenjoy.kit.TypeKit import TypeKit
assert TypeKit.to_int("123") == 123
assert TypeKit.to_float("3.14") == 3.14