#NEWLINE# def test_descendant_rule_registration( test_app , test_pilot ) : #NEWLINE# #INDENT# 'Test registering a hierarchy of rules.' #NEWLINE# test_pilot . init_app ( test_app ) #NEWLINE# @ test_app . route ( '/' , navbar_kwargs = { #NEWLINE# #INDENT# 'path' : ( 'Home' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def home( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# @ test_app . route ( '/foo/bar/baz/' , navbar_kwargs = { #NEWLINE# #INDENT# 'path' : ( 'Foo' , 'Bar' , 'Baz' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def baz( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# @ test_app . route ( '/foo/bar/quux/' , navbar_kwargs = { #NEWLINE# #INDENT# 'path' : ( 'Foo' , 'Bar' , 'Quux' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def quux( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# assert ( len ( test_pilot . navbar_entries ) == 2 ) #NEWLINE# foo = test_pilot . navbar_entries [ 0 ] #NEWLINE# assert ( foo . name == 'Foo' ) #NEWLINE# assert ( len ( foo . children ) == 1 ) #NEWLINE# bar = foo . children [ 0 ] #NEWLINE# assert ( len ( bar . children ) == 2 ) #NEWLINE# assert ( bar . children [ 0 ] . name == 'Baz' ) #NEWLINE# assert ( bar . children [ 1 ] . name == 'Quux' )