#NEWLINE# def test_initializer( ) : #NEWLINE# #INDENT# app = Flask ( __name__ ) #NEWLINE# app . config . setdefault ( 'BIU_NUM' , 42 ) #NEWLINE# nav = Navigation ( ) #NEWLINE# nav . init_app ( app ) #NEWLINE# woo = nav . Bar ( 'woo' ) #NEWLINE# @ woo . initializer #NEWLINE# def initialize_woo( nav ) : #NEWLINE# #INDENT# boom_num = current_app . config [ 'BIU_NUM' ] #NEWLINE# nav [ 'woo' ] . items . extend ( [ nav . Item ( 'Boom' , endpoint = 'biu' , args = { #NEWLINE# #INDENT# 'num' : boom_num , #NEWLINE# #UNINDENT# } ) ] ) #NEWLINE# #UNINDENT# @ app . route ( '/' ) #NEWLINE# def index( ) : #NEWLINE# #INDENT# return woo . items [ 0 ] . url #NEWLINE# #UNINDENT# @ app . route ( '/biu/<int:num>' ) #NEWLINE# def biu( ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# with app . test_client ( ) as c : #NEWLINE# #INDENT# url = c . get ( '/' ) #NEWLINE# assert ( url . data == b'/biu/42' )