def test_get_resources_with_stub_mgr(self):

    class GooGoose(wsgi.Controller):

        @wsgi.extends
        def show(self, req, resp_obj, id):
            resp_obj.obj['flavor']['googoose'] = req.GET.get('chewing')
    req_ext = base_extensions.ControllerExtension(StubControllerExtension(), 'flavors', GooGoose())
    manager = StubExtensionManager(None, None, None, req_ext)
    app = fakes.wsgi_app(ext_mgr=manager)
    request = webob.Request.blank('/v2/fake/flavors/1?chewing=bluegoo')
    request.environ['api.version'] = '2'
    response = request.get_response(app)
    self.assertEqual(200, response.status_int)
    response_data = jsonutils.loads(response.body)
    self.assertEqual('bluegoo', response_data['flavor']['googoose'])
def test_get_resources_with_stub_mgr(self):

    class GooGoose(wsgi.Controller):

        @wsgi.extends
        def show(self, req, resp_obj, id):
            resp_obj.obj['flavor']['googoose'] = req.GET.get('chewing')
    req_ext = base_extensions.ControllerExtension(StubControllerExtension(), 'flavors', GooGoose())
    manager = StubExtensionManager(None, None, None, req_ext)
    app = fakes.wsgi_app(ext_mgr=manager)
    request = webob.Request.blank('/v2/fake/flavors/1?chewing=bluegoo')
    request.environ['api.version'] = '2'
    response = request.get_response(app)
    self.assertEqual(200, response.status_int)
    response_data = jsonutils.loads(response.body)
    self.assertEqual('bluegoo', response_data['flavor']['googoose'])