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)])
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) ])
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)
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)
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(), [])