⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_sxp.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
import unittestimport xen.xend.sxpclass test_sxp(unittest.TestCase):    def testAllFromString(self):        def t(inp, expected):            self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)        t('String',           ['String'])        t('(String Thing)',   [['String', 'Thing']])        t('(String) (Thing)', [['String'], ['Thing']])    def testParseFixed(self):        fin = file('../xen/xend/tests/xend-config.sxp', 'rb')        try:            config = xen.xend.sxp.parse(fin)            self.assertEqual(                xen.xend.sxp.child_value(                config,                'xend-relocation-hosts-allow'),                '^localhost$ ^localhost\\.localdomain$')        finally:            fin.close()    def testParseConfigExample(self):        fin = file('../../examples/xend-config.sxp', 'rb')        try:            config = xen.xend.sxp.parse(fin)        finally:            fin.close()def test_suite():    return unittest.makeSuite(test_sxp)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -