#NEWLINE# def test_filesystem_session( self ) : #NEWLINE# #INDENT# app = flask . Flask ( __name__ ) #NEWLINE# app . config [ 'SESSION_TYPE' ] = 'filesystem' #NEWLINE# app . config [ 'SESSION_FILE_DIR' ] = tempfile . gettempdir ( ) #NEWLINE# Session ( delete ) #NEWLINE# @ app . route ( '/set' , methods = [ 'POST' ] ) #NEWLINE# def set( ) : #NEWLINE# #INDENT# flask . session [ 'value' ] = flask . request . form [ 'value' ] #NEWLINE# return 'value set' #NEWLINE# #UNINDENT# @ app . route ( '/get' ) #NEWLINE# def get( ) : #NEWLINE# #INDENT# return flask . session [ 'value' ] #NEWLINE# #UNINDENT# @ app . route ( '/delete' , methods = [ 'POST' ] ) #NEWLINE# def delete( ) : #NEWLINE# #INDENT# del flask . session [ 'value' ] #NEWLINE# return 'value deleted' #NEWLINE# #UNINDENT# c = app . test_client ( ) #NEWLINE# self . assertEqual ( c . post ( '/set' , data = { #NEWLINE# #INDENT# 'value' : '42' , #NEWLINE# #UNINDENT# } ) . data , b'value set' ) #NEWLINE# self . assertEqual ( c . get ( '/get' ) . data , b'42' ) #NEWLINE# c . post ( '/delete' )