You've already forked HeurAMS-legacy
fix
This commit is contained in:
@@ -16,13 +16,13 @@ class TestClozePuzzle(unittest.TestCase):
|
||||
self.assertEqual(puzzle.wording, "填空题 - 尚未刷新谜题")
|
||||
self.assertEqual(puzzle.answer, ["填空题 - 尚未刷新谜题"])
|
||||
|
||||
@patch('random.sample')
|
||||
@patch("random.sample")
|
||||
def test_refresh(self, mock_sample):
|
||||
"""测试 refresh 方法"""
|
||||
mock_sample.return_value = [0, 2] # 选择索引 0 和 2
|
||||
puzzle = ClozePuzzle("hello/world/test", min_denominator=2, delimiter="/")
|
||||
puzzle.refresh()
|
||||
|
||||
|
||||
# 检查 wording 和 answer
|
||||
self.assertNotEqual(puzzle.wording, "填空题 - 尚未刷新谜题")
|
||||
self.assertNotEqual(puzzle.answer, ["填空题 - 尚未刷新谜题"])
|
||||
@@ -47,5 +47,5 @@ class TestClozePuzzle(unittest.TestCase):
|
||||
self.assertIn("填空题 - 尚未刷新谜题", str_repr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user