#NEWLINE# def test_traject_consume_view( ) : #NEWLINE# #INDENT# class app ( morepath . App ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# dectate . commit ( app ) #NEWLINE# traject = app . config . path_registry #NEWLINE# def get_model( foo ) : #NEWLINE# #INDENT# result = Model ( ) #NEWLINE# result . foo = foo #NEWLINE# return result #NEWLINE# #UNINDENT# traject . add_pattern ( '' , ( Root , paramfac ) ) #NEWLINE# traject . add_pattern ( '{foo}' , ( traject , paramfac ) ) #NEWLINE# ( found , request ) = consume ( app ( ) , '+something' ) #NEWLINE# assert isinstance ( found , Root ) #NEWLINE# assert ( request . unconsumed == [ '+something' ] )