完成 0.4.0 版本更新, 为了消除此前提交消息风格不一致与错误提交超大文件的问题, 维持代码统计数据的准确性和提交消息风格的一致性, 重新初始化仓库; 旧的提交历史在 HeurAMS-legacy 仓库(https://gitea.imwangzhiyu.xyz/ajax/HeurAMS-legacy)
24 lines
594 B
Python
24 lines
594 B
Python
import unittest
|
|
from unittest.mock import Mock
|
|
|
|
from heurams.kernel.puzzles.base import BasePuzzle
|
|
|
|
|
|
class TestBasePuzzle(unittest.TestCase):
|
|
"""测试 BasePuzzle 基类"""
|
|
|
|
def test_refresh_not_implemented(self):
|
|
"""测试 refresh 方法未实现时抛出异常"""
|
|
puzzle = BasePuzzle()
|
|
with self.assertRaises(NotImplementedError):
|
|
puzzle.refresh()
|
|
|
|
def test_str(self):
|
|
"""测试 __str__ 方法"""
|
|
puzzle = BasePuzzle()
|
|
self.assertEqual(str(puzzle), "谜题: BasePuzzle")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|