def test_get_layout_adds_layout_to_event_data(self): event = data_structures.AttributeDict( request=data_structures.AttributeDict( registry=data_structures.AttributeDict(settings={})), ) renderer = MockRenderer() with mock.patch('pyramid.renderers.get_renderer') as patch: patch.return_value = renderer subscribers.get_layout(event) self.assertIs(event.get('layout'), renderer._implementation)
def test_keys_can_be_accessed_as_keys(self): obj = data_structures.AttributeDict() obj['key'] = 'value' self.assertEquals(obj['key'], 'value')
def test_attributes_can_be_accessed_as_attributes(self): obj = data_structures.AttributeDict() obj.key = 'value' self.assertEquals(obj.key, 'value')