def test_constructor_renderer_registration(self):
        get_request_obj = lambda *args, **kwargs: Request(EnvironBuilder(*args, **kwargs).get_environ())

        pushrod = Pushrod(renderers=['json'])

        assert pushrod.default_renderer == None

        assert 'html' not in pushrod.named_renderers
        assert 'text/html' not in pushrod.mime_type_renderers

        assert 'json' in pushrod.named_renderers
        assert 'application/json' in pushrod.mime_type_renderers

        assert pushrod.named_renderers['json'] == json_renderer
        assert pushrod.mime_type_renderers['application/json'] == json_renderer

        assert pushrod.get_renderers_for_request(get_request_obj("/")) == []
        assert pushrod.get_renderers_for_request(get_request_obj("/?format=json")) == [json_renderer]

        pushrod = Pushrod(renderers=[repr_renderer])

        assert 'html' not in pushrod.named_renderers
        assert 'text/html' not in pushrod.named_renderers

        assert 'json' not in pushrod.named_renderers
        assert 'application/json' not in pushrod.mime_type_renderers

        assert 'repr' in pushrod.named_renderers

        assert pushrod.named_renderers['repr'] == repr_renderer

        assert pushrod.get_renderers_for_request(get_request_obj("/")) == []
        assert pushrod.get_renderers_for_request(get_request_obj("/?format=repr")) == [repr_renderer]

        pushrod = Pushrod(renderers=[repr_renderer], default_renderer='repr')

        assert pushrod.get_renderers_for_request(get_request_obj("/")) == [repr_renderer]

        with self.app.app_context():
            Pushrod(renderers=[])

        Pushrod(self.app, renderers=[])

        Pushrod(self.app, default_renderer=repr_renderer)
dataset/ETHPy150Open teozkr/Flask-Pushrod/flask_pushrod/test_all.py/PushrodResolverTestCase.test_constructor_renderer_registration/original