Module ImportFrom alias alias ImportFrom alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr keyword AttributeLoad NameLoad attr decorator_list decorator_list Expr Call NameLoad NameLoad NameLoad NameLoad ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str ClassDef bases NameLoad body Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad decorator_list decorator_list Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad Call AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call NameLoad Num Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad With Call AttributeLoad NameLoad attr Str NameStore body FunctionDef arguments args NameParam defaults body Return Str decorator_list Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call NameLoad Num Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call NameLoad Num Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call NameLoad Num Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list Call AttributeLoad NameLoad attr Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Str Str Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad ClassDef bases NameLoad body Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return Str decorator_list Call AttributeLoad NameLoad attr Str decorator_list Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad Num Str Expr Call AttributeLoad NameLoad attr NameLoad ListLoad TupleLoad NameLoad Call NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Return Str decorator_list Call AttributeLoad NameLoad attr Str decorator_list Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Return Str decorator_list Call AttributeLoad NameLoad attr Str keyword NameLoad decorator_list Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list Call AttributeLoad NameLoad attr Str keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Dict Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Num keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str decorator_list
N/A __future__ absolute_import division twisted.trial unittest N/A sys mock Mock patch twisted.python.components registerAdapter klein Klein klein.app KleinRequest klein.interfaces IKleinRequest klein.test.util EqualityTestsMixin DummyRequest N/A object N/A __init__ N/A N/A self n N/A N/A N/A N/A self n n N/A __eq__ N/A N/A self other N/A N/A N/A N/A N/A other n N/A self n N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A <DummyRequest({n})> format n N/A self n N/A N/A N/A N/A registerAdapter KleinRequest DummyRequest IKleinRequest KleinEqualityTestCase N/A N/A unittest TestCase EqualityTestsMixin N/A N/A 
    Tests for L{Klein}'s implementation of C{==} and C{!=}.
     _One N/A object N/A N/A app N/A Klein __eq__ N/A N/A self other N/A N/A N/A True N/A __ne__ N/A N/A self other N/A N/A N/A False N/A __hash__ N/A N/A self N/A N/A N/A N/A id self N/A N/A N/A _another N/A Klein anInstance N/A N/A self N/A N/A N/A N/A N/A N/A self _One app N/A anotherInstance N/A N/A self N/A N/A N/A N/A self _another N/A N/A KleinTestCase N/A N/A unittest TestCase N/A test_route N/A N/A self N/A N/A N/A 
        L{Klein.route} adds functions as routable endpoints.
         N/A app N/A Klein foo N/A N/A request N/A N/A N/A foo N/A N/A N/A app route /foo N/A c N/A N/A N/A app url_map bind foo N/A N/A N/A self assertEqual N/A N/A c match /foo N/A foo N/A N/A N/A N/A self assertEqual N/A len N/A app endpoints 1 N/A N/A N/A self assertEqual N/A N/A app execute_endpoint foo N/A DummyRequest 1 foo N/A test_submountedRoute N/A N/A self N/A N/A N/A 
        L{Klein.subroute} adds functions as routable endpoints.
         N/A app N/A Klein N/A N/A N/A app subroute /sub app N/A foo_endpoint N/A N/A request N/A N/A N/A foo N/A N/A N/A app route /prefixed_uri N/A c N/A N/A N/A app url_map bind sub/prefixed_uri N/A N/A N/A self assertEqual N/A N/A c match /sub/prefixed_uri N/A foo_endpoint N/A N/A N/A N/A self assertEqual N/A len N/A app endpoints 1 N/A N/A N/A self assertEqual N/A N/A app execute_endpoint foo_endpoint N/A DummyRequest 1 foo N/A test_stackedRoute N/A N/A self N/A N/A N/A 
        L{Klein.route} can be stacked to create multiple endpoints of
        a single function.
         N/A app N/A Klein foobar N/A N/A request N/A N/A N/A foobar N/A N/A N/A app route /foo N/A N/A app route /bar endpoint bar N/A N/A N/A self assertEqual N/A len N/A app endpoints 2 N/A c N/A N/A N/A app url_map bind foo N/A N/A N/A self assertEqual N/A N/A c match /foo N/A foobar N/A N/A N/A N/A self assertEqual N/A N/A app execute_endpoint foobar N/A DummyRequest 1 foobar N/A N/A N/A self assertEqual N/A N/A c match /bar N/A bar N/A N/A N/A N/A self assertEqual N/A N/A app execute_endpoint bar N/A DummyRequest 2 foobar N/A test_branchRoute N/A N/A self N/A N/A N/A 
        L{Klein.route} should create a branch path which consumes all children
        when the branch keyword argument is True.
         N/A app N/A Klein foo N/A N/A request N/A N/A N/A foo N/A N/A N/A app route /foo/ branch True N/A c N/A N/A N/A app url_map bind foo N/A N/A N/A self assertEqual N/A N/A c match /foo/ N/A foo N/A N/A N/A N/A self assertEqual N/A N/A c match /foo/bar N/A foo_branch N/A __rest__ bar N/A N/A N/A self assertEquals N/A N/A N/A app endpoints N/A foo __name__ foo N/A N/A N/A self assertEquals N/A N/A N/A app endpoints N/A foo_branch __name__ foo N/A test_classicalRoute N/A N/A self N/A N/A N/A 
        L{Klein.route} may be used a method decorator when a L{Klein} instance
        is defined as a class variable.
         N/A bar_calls N/A Foo N/A object N/A N/A app N/A Klein bar N/A N/A self request N/A N/A N/A N/A N/A bar_calls append N/A self request N/A bar N/A N/A N/A app route /bar N/A N/A foo N/A Foo N/A c N/A N/A N/A N/A foo app url_map bind bar N/A N/A N/A self assertEqual N/A N/A c match /bar N/A bar N/A N/A N/A N/A self assertEquals N/A N/A N/A foo app execute_endpoint bar N/A DummyRequest 1 bar N/A N/A N/A self assertEqual bar_calls N/A N/A foo N/A DummyRequest 1 N/A test_classicalRouteWithTwoInstances N/A N/A self N/A N/A N/A 
        Multiple instances of a class with a L{Klein} attribute and
        L{Klein.route}'d methods can be created and their L{Klein}s used
        independently.
         Foo N/A object N/A N/A app N/A Klein __init__ N/A N/A self N/A N/A N/A N/A self bar_calls N/A N/A bar N/A N/A self request N/A N/A N/A N/A N/A N/A self bar_calls append N/A self request N/A bar N/A N/A N/A app route /bar N/A N/A foo_1 N/A Foo N/A foo_1_app N/A foo_1 app N/A foo_2 N/A Foo N/A foo_2_app N/A foo_2 app N/A dr1 N/A DummyRequest 1 N/A dr2 N/A DummyRequest 2 N/A N/A N/A foo_1_app execute_endpoint bar dr1 N/A N/A N/A foo_2_app execute_endpoint bar dr2 N/A N/A N/A self assertEqual N/A foo_1 bar_calls N/A N/A foo_1 dr1 N/A N/A N/A self assertEqual N/A foo_2 bar_calls N/A N/A foo_2 dr2 N/A test_classicalRouteWithBranch N/A N/A self N/A N/A N/A 
        Multiple instances of a class with a L{Klein} attribute and
        L{Klein.route}'d methods can be created and their L{Klein}s used
        independently.
         Foo N/A object N/A N/A app N/A Klein __init__ N/A N/A self N/A N/A N/A N/A self bar_calls N/A N/A bar N/A N/A self request N/A N/A N/A N/A N/A N/A self bar_calls append N/A self request N/A bar N/A N/A N/A app route /bar/ branch True N/A N/A foo_1 N/A Foo N/A foo_1_app N/A foo_1 app N/A foo_2 N/A Foo N/A foo_2_app N/A foo_2 app N/A dr1 N/A DummyRequest 1 N/A dr2 N/A DummyRequest 2 N/A N/A N/A foo_1_app execute_endpoint bar_branch dr1 N/A N/A N/A foo_2_app execute_endpoint bar_branch dr2 N/A N/A N/A self assertEqual N/A foo_1 bar_calls N/A N/A foo_1 dr1 N/A N/A N/A self assertEqual N/A foo_2 bar_calls N/A N/A foo_2 dr2 N/A test_branchDoesntRequireTrailingSlash N/A N/A self N/A N/A N/A 
        L{Klein.route} should create a branch path which consumes all children,
        when the branch keyword argument is True and there is no trailing /
        on the path.
         N/A app N/A Klein foo N/A N/A request N/A N/A N/A foo N/A N/A N/A app route /foo branch True N/A c N/A N/A N/A app url_map bind foo N/A N/A N/A self assertEqual N/A N/A c match /foo/bar N/A foo_branch N/A __rest__ bar N/A test_run N/A N/A self reactor mock_log mock_site mock_kr N/A N/A N/A 
        L{Klein.run} configures a L{KleinResource} and a L{Site}
        listening on the specified interface and port, and logs
        to stdout.
         N/A app N/A Klein N/A N/A N/A app run localhost 8080 N/A N/A N/A N/A reactor listenTCP assert_called_with 8080 N/A mock_site return_value interface localhost N/A N/A N/A N/A reactor run assert_called_with N/A N/A N/A mock_site assert_called_with N/A mock_kr return_value N/A N/A N/A mock_kr assert_called_with app N/A N/A N/A N/A mock_log startLogging assert_called_with N/A sys stdout N/A N/A patch klein.app.KleinResource N/A patch klein.app.Site N/A patch klein.app.log N/A patch klein.app.reactor test_runWithLogFile N/A N/A self reactor mock_log mock_site mock_kr N/A N/A N/A 
        L{Klein.run} logs to the specified C{logFile}.
         N/A app N/A Klein N/A logFile N/A Mock N/A N/A N/A app run localhost 8080 logFile logFile N/A N/A N/A N/A reactor listenTCP assert_called_with 8080 N/A mock_site return_value interface localhost N/A N/A N/A N/A reactor run assert_called_with N/A N/A N/A mock_site assert_called_with N/A mock_kr return_value N/A N/A N/A mock_kr assert_called_with app N/A N/A N/A N/A mock_log startLogging assert_called_with logFile N/A N/A patch klein.app.KleinResource N/A patch klein.app.Site N/A patch klein.app.log N/A patch klein.app.reactor test_resource N/A N/A self mock_kr N/A N/A N/A 
        L{Klien.resource} returns a L{KleinResource}.
         N/A app N/A Klein N/A resource N/A N/A app resource N/A N/A N/A mock_kr assert_called_with app N/A N/A N/A self assertEqual N/A mock_kr return_value resource N/A N/A patch klein.app.KleinResource N/A