feat(T-001): 初始化 Python 项目骨架
- 建立 src/(main.py 最小可运行入口)、tests/(unittest 冒烟测试)、requirements.txt。 - 骨架阶段测试用标准库 unittest,零第三方依赖;pytest 留待后续按需引入。 - 文档占位符验证命令替换为真实命令(pytest -> unittest discover)。 - 同步 tasks.md(T-001 DONE)、progress.md、current-state.md。 验证:compileall OK;unittest 2 passed;python src/main.py exit=0。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
541dfab967
commit
2863bf2750
@@ -0,0 +1,22 @@
|
||||
"""项目骨架冒烟测试(T-001)。
|
||||
|
||||
确保最小入口可导入、可运行,为后续任务提供可运行的测试基线。
|
||||
"""
|
||||
import unittest
|
||||
|
||||
from src.main import APP_NAME, APP_VERSION, main
|
||||
|
||||
|
||||
class SmokeTest(unittest.TestCase):
|
||||
def test_main_returns_zero(self):
|
||||
"""最小入口应正常返回退出码 0。"""
|
||||
self.assertEqual(main(), 0)
|
||||
|
||||
def test_app_metadata_present(self):
|
||||
"""应用名与版本号不应为空。"""
|
||||
self.assertTrue(APP_NAME)
|
||||
self.assertTrue(APP_VERSION)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user