'L{getRoutes} returns all the defined routes and their attributes.'

def test_routes(self):

    app = Klein()
    def f():
        pass
    f.attr = 'attr'
    def g():
        pass
    g.attr = 'G'
    app.route('/', methods=['GET'])(f)
    app.route('/g', methods=['PUT', 'OPTIONS'])(g)
    routes = sorted(getRoutes(app))
    self.assertEqual(routes, [KleinRoute(methods={'GET'}, path='/', endpoint='f', attributes={'attr': 'attr'}), KleinRoute(methods={'PUT', 'OPTIONS'}, path='/g', endpoint='g', attributes={'attr': 'G'})])
