예제 #1
0
 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
0
 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
예제 #3
0
 def test_getDisassembledPickleData(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.pickledState = b''
     self.assertEqual(
         view.getDisassembledPickleData(),
         'ValueError: pickle exhausted before seeing STOP\n\n'
         'ValueError: pickle exhausted before seeing STOP\n')
예제 #4
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)])
예제 #5
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)
     ])
예제 #6
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)
예제 #7
0
 def test_listItems_empty(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.listItems = lambda: []
     self.assertEquals(view.listItems(), [])
예제 #8
0
 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)
예제 #9
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)
예제 #10
0
 def test_listItems_empty(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.listItems = lambda: []
     self.assertEqual(view.listItems(), [])
예제 #11
0
 def test_listAttributes_none_exist(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.requestedTid = 42
     view.state.listAttributes = lambda: None
     self.assertEqual(view.listAttributes(), None)
예제 #12
0
 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(), [])