예제 #1
0
 def test_listAttributes(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.requestedTid = 42
     view.state.listAttributes = lambda: [('zoinks', 17),
                                          ('scoobysnack', None)]
     self.assertEquals(view.listAttributes(),
                       [ZodbObjectAttribute('scoobysnack', None, 42),
                        ZodbObjectAttribute('zoinks', 17, 42)])
예제 #2
0
 def test_listAttributes(self):
     view = ZodbInfoView(None, None)
     view.state = ZodbObjectStateStub(PersistentStub())
     view.state.requestedTid = 42
     view.state.listAttributes = lambda: [('zoinks', 17),
                                          ('scoobysnack', None)]
     self.assertEqual(view.listAttributes(), [
         ZodbObjectAttribute('scoobysnack', None, 42),
         ZodbObjectAttribute('zoinks', 17, 42)
     ])
예제 #3
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)
예제 #4
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)
예제 #5
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(), [])