本文整理匯總了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(), [])