本文整理汇总了Python中zodbbrowser.browser.ZodbInfoView.state方法的典型用法代码示例。如果您正苦于以下问题:Python ZodbInfoView.state方法的具体用法?Python ZodbInfoView.state怎么用?Python ZodbInfoView.state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zodbbrowser.browser.ZodbInfoView
的用法示例。
在下文中一共展示了ZodbInfoView.state方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createView
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def createView(self, obj):
view = ZodbInfoView(obj, TestRequest())
view.obj = obj
view.state = ZodbObjectStateStub(view.obj)
view.requestedTid = None
view.getRootOid = lambda: 1
return view
示例2: test_listItems
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def test_listItems(self):
view = ZodbInfoView(None, None)
view.state = ZodbObjectStateStub(PersistentStub())
view.state.requestedTid = 42
view.state.listItems = lambda: [('zoinks', 17),
('scoobysnack', None)]
self.assertEquals(view.listItems(),
[ZodbObjectAttribute('zoinks', 17, 42),
ZodbObjectAttribute('scoobysnack', None, 42)])
示例3: test_listItems_none_exist
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def test_listItems_none_exist(self):
view = ZodbInfoView(None, None)
view.state = ZodbObjectStateStub(PersistentStub())
view.state.listItems = lambda: None
self.assertEquals(view.listItems(), None)
示例4: test_listItems_empty
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def test_listItems_empty(self):
view = ZodbInfoView(None, None)
view.state = ZodbObjectStateStub(PersistentStub())
view.state.listItems = lambda: []
self.assertEquals(view.listItems(), [])
示例5: test_listAttributes_none_exist
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def test_listAttributes_none_exist(self):
view = ZodbInfoView(None, None)
view.state = ZodbObjectStateStub(PersistentStub())
view.state.requestedTid = 42
view.state.listAttributes = lambda: None
self.assertEquals(view.listAttributes(), None)
示例6: test_listAttributes_empty
# 需要导入模块: from zodbbrowser.browser import ZodbInfoView [as 别名]
# 或者: from zodbbrowser.browser.ZodbInfoView import state [as 别名]
def test_listAttributes_empty(self):
view = ZodbInfoView(None, None)
view.state = ZodbObjectStateStub(PersistentStub())
view.state.requestedTid = 42
view.state.listAttributes = lambda: []
self.assertEqual(view.listAttributes(), [])