Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def test_keys_can_be_accessed_as_keys(self):
     obj = data_structures.AttributeDict()
     obj['key'] = 'value'
     self.assertEquals(obj['key'], 'value')
Exemplo n.º 3
0
 def test_attributes_can_be_accessed_as_attributes(self):
     obj = data_structures.AttributeDict()
     obj.key = 'value'
     self.assertEquals(obj.key, 'value')