test_uuid.py
来自「xen虚拟机源代码安装包」· Python 代码 · 共 31 行
PY
31 行
import unittestfrom xen.xend import uuidclass test_uuid(unittest.TestCase): def testStringRoundtrip(self): def t(inp): self.assertEqual(uuid.fromString(uuid.toString(inp)), inp) t(uuid.create()) t(uuid.create()) t(uuid.create()) t(uuid.create()) t(uuid.create()) def testToFromString(self): def t(inp, expected): self.assertEqual(uuid.toString(inp), expected) self.assertEqual(uuid.fromString(expected), inp) t([0 for _ in range(0, 16)], "00000000-0000-0000-0000-000000000000") t([185, 158, 125, 206, 250, 178, 125, 57, 2, 6, 162, 74, 178, 236, 196, 5], "b99e7dce-fab2-7d39-0206-a24ab2ecc405")def test_suite(): return unittest.makeSuite(test_uuid)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?