'Test that params can be accessed from within process_resource'

def test_can_access_resource_params(self):

    global context
    class Resource:
        def on_get(self, req, resp, **params):
            resp.body = json.dumps(params)
    app = falcon.API(middleware=AccessParamsMiddleware())
    app.add_route('/path/{id}', Resource())
    client = testing.TestClient(app)
    response = client.simulate_request(path='/path/22')
    assert ('params' in context)
    assert context['params']
    assert (context['params']['id'] == '22')
    assert (response.json == {'added': True, 'id': '22'})
