def test_no_resource_processor_routing(self):
        config = dict(
            routing = dict(
                __config__ = dict(processor='pipeline.root_pipeline', no_resource_processor='pipeline.root_no_resource_pipeline'),
                foo = dict(
                    __config__ = dict(processor = 'pipeline.foo_pipeline')
                ),
                bar = dict(
                    baz = dict(
                        __config__ = dict(no_resource_processor = 'pipeline.baz_pipeline')
                    )
                )
            )
        )

        web_site = self.getConfiguredWebSite(config)

        root_resource = self.getResourceForFakeRequest(web_site, [''])
        self.assertConfiguredWithProcessor(root_resource, processor='pipeline.root_pipeline', no_resource_processor='pipeline.root_no_resource_pipeline')

        # nonexistent resources should be rendered by the closest matching no-resource-pipeline_dependency
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['nonexistent']), root_resource)
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['nonexistent', 'nested']), root_resource)
        # since foo does not have a no_resource_processor, its no_resources should be rendered by the root_resource
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['foo', 'nonexistent']), root_resource)
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['foo', 'nonexistent', 'nested']), root_resource)
        # since bar does not have a processor/no_resource_processor, it should be rendered by the root_resource
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['bar']), root_resource)

        self.assertConfiguredWithProcessor(self.getResourceForFakeRequest(web_site, ['foo']), processor='pipeline.foo_pipeline')
        self.assertConfiguredWithProcessor(self.getResourceForFakeRequest(web_site, ['foo', '']), processor='pipeline.foo_pipeline')

        baz_resource = self.getResourceForFakeRequest(web_site, ['bar', 'baz'])
        self.assertConfiguredWithProcessor(baz_resource, no_resource_processor='pipeline.baz_pipeline')

        # since baz has a no_resource_processor, it is capable of rendering that itself doesn't have a "proper" resource/processor
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['bar', 'baz', '']), baz_resource)
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['bar', 'baz', 'nonexistent']), baz_resource)
        self.assertEquals(self.getResourceForFakeRequest(web_site, ['bar', 'baz', 'nonexistent', 'nested']), baz_resource)