Пример #1
0
 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)])
Пример #2
0
 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.assertEqual(view.listItems(), [
         ZodbObjectAttribute('zoinks', 17, 42),
         ZodbObjectAttribute('scoobysnack', None, 42)
     ])
Пример #3
0
 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
0
 def test_listItems_empty(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.listItems = lambda: []
     self.assertEquals(view.listItems(), [])
Пример #5
0
 def test_listItems_none_exist(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.listItems = lambda: None
     self.assertEqual(view.listItems(), None)
Пример #6
0
 def test_listItems_empty(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.listItems = lambda: []
     self.assertEqual(view.listItems(), [])