• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python aot.jellyToSource函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twisted.persisted.aot.jellyToSource函数的典型用法代码示例。如果您正苦于以下问题:Python jellyToSource函数的具体用法?Python jellyToSource怎么用?Python jellyToSource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了jellyToSource函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_copyReg

 def test_copyReg(self):
     s = "foo_bar"
     sio = StringIO.StringIO()
     sio.write(s)
     uj = aot.unjellyFromSource(aot.jellyToSource(sio))
     # print repr(uj.__dict__)
     assert uj.getvalue() == s
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:7,代码来源:test_persisted.py


示例2: test_methodSelfIdentity

 def test_methodSelfIdentity(self):
     a = A()
     b = B()
     a.bmethod = b.bmethod
     b.a = a
     im_ = aot.unjellyFromSource(aot.jellyToSource(b)).a.bmethod
     self.assertEqual(im_.im_class, im_.im_self.__class__)
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:7,代码来源:test_persisted.py


示例3: test_copyReg

 def test_copyReg(self):
     """
     L{aot.jellyToSource} and L{aot.unjellyFromSource} honor functions
     registered in the pickle copy registry.
     """
     uj = aot.unjellyFromSource(aot.jellyToSource(CopyRegistered()))
     self.assertIsInstance(uj, CopyRegisteredLoaded)
开发者ID:marcelpetersen,项目名称:localnews,代码行数:7,代码来源:test_persisted.py


示例4: test_methodSelfIdentity

 def test_methodSelfIdentity(self):
     a = A()
     b = B()
     a.bmethod = b.bmethod
     b.a = a
     im_ = aot.unjellyFromSource(aot.jellyToSource(b)).a.bmethod
     self.assertEqual(aot._selfOfMethod(im_).__class__,
                      aot._classOfMethod(im_))
开发者ID:marcelpetersen,项目名称:localnews,代码行数:8,代码来源:test_persisted.py


示例5: test_methodNotSelfIdentity

 def test_methodNotSelfIdentity(self):
     """
     If a class change after an instance has been created,
     L{aot.unjellyFromSource} shoud raise a C{TypeError} when trying to
     unjelly the instance.
     """
     a = A()
     b = B()
     a.bmethod = b.bmethod
     b.a = a
     savedbmethod = B.bmethod
     del B.bmethod
     try:
         self.assertRaises(TypeError, aot.unjellyFromSource,
                           aot.jellyToSource(b))
     finally:
         B.bmethod = savedbmethod
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:17,代码来源:test_persisted.py


示例6: test_basicIdentity

 def test_basicIdentity(self):
     # Anyone wanting to make this datastructure more complex, and thus this
     # test more comprehensive, is welcome to do so.
     aj = aot.AOTJellier().jellyToAO
     d = {'hello': 'world', "method": aj}
     l = [1, 2, 3,
          "he\tllo\n\n\"x world!",
          u"goodbye \n\t\u1010 world!",
          1, 1.0, 100 ** 100l, unittest, aot.AOTJellier, d,
          funktion
          ]
     t = tuple(l)
     l.append(l)
     l.append(t)
     l.append(t)
     uj = aot.unjellyFromSource(aot.jellyToSource([l, l]))
     assert uj[0] is uj[1]
     assert uj[1][0:5] == l[0:5]
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:18,代码来源:test_persisted.py


示例7: test_nonDictState

 def test_nonDictState(self):
     a = NonDictState()
     a.state = "meringue!"
     assert aot.unjellyFromSource(aot.jellyToSource(a)).state == a.state
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:4,代码来源:test_persisted.py


示例8: test_simpleTypes

 def test_simpleTypes(self):
     obj = (1, 2.0, 3j, True, slice(1, 2, 3), 'hello', u'world', sys.maxint + 1, None, Ellipsis)
     rtObj = aot.unjellyFromSource(aot.jellyToSource(obj))
     self.assertEqual(obj, rtObj)
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:4,代码来源:test_persisted.py



注:本文中的twisted.persisted.aot.jellyToSource函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sob.load函数代码示例发布时间:2022-05-27
下一篇:
Python srvconnect.SRVConnector类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap