@@ -0,0 +1,1206 @@
+#!/usr/bin/env python%0A# coding=utf-8%0A#  %E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6%0A%0Aimport sys%0Asys.path.append('../')%0A%0Afrom game import Scene%0Aimport unittest%0A%0Aclass Scene_test(unittest.TestCase):%0A%0A    def setUp(self):%0A        '''%E5%88%9D%E5%A7%8B%E5%8C%96'''%0A        self.scene = Scene('58d0b8a4b4851837d6c1f2c1')%0A%0A    def test_name(self):%0A        '''%E5%9C%BA%E6%99%AF%E5%90%8D%E7%A7%B0'''%0A        self.assertIsInstance(self.scene.name, str)%0A%0A    def test_refresh(self):%0A        '''%E5%88%B7%E6%96%B0%E6%97%B6%E9%97%B4'''%0A        self.assertTrue(self.scene.refresh)%0A        self.assertIsInstance(self.scene.refresh, int)%0A%0A    def test_desc(self):%0A        '''%E5%9C%BA%E6%99%AF%E7%AE%80%E4%BB%8B'''%0A        self.assertIsInstance(self.scene.desc, str)%0A%0A    def test_pic(self):%0A        '''%E5%9C%BA%E6%99%AF%E5%9B%BE%E7%89%87'''%0A        self.assertIsInstance(self.scene.pic, str)%0A%0A    def test_is_safety(self):%0A        '''%E6%98%AF%E5%90%A6%E6%98%AF%E5%AE%89%E5%85%A8%E5%8C%BA'''%0A        self.assertIsInstance(self.scene.is_safety, bool)%0A%0A    def test_ops(self):%0A        '''%E5%9C%BA%E6%99%AF%E6%89%80%E5%90%AB%E6%93%8D%E4%BD%9C'''%0A        self.assertIsInstance(self.scene.ops(), list)%0A%0A    def test_events(self):%0A        '''%E5%9C%BA%E6%99%AF%E4%BA%8B%E4%BB%B6'''%0A        self.assertIsInstance(self.scene.events, dict)%0A%0A    def test_npc(self):%0A        '''%E5%9C%BA%E6%99%AFnpc'''%0A        self.assertIsNotNone(self.scene.npc)%0A        self.assertIsInstance(self.scene.npc, list)%0A%0A    # def%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

添加 游戏场景测试文件