#NEWLINE# def test_get_datastore_session( self ) : #NEWLINE# #INDENT# class MyHandler ( BaseHandler ) : #NEWLINE# #INDENT# def get( self ) : #NEWLINE# #INDENT# session = self . session_store . get_session ( backend = 'datastore' ) #NEWLINE# res = session . get ( 'test' ) #NEWLINE# if ( not res ) : #NEWLINE# #INDENT# res = 'undefined' #NEWLINE# session [ 'test' ] = 'a datastore session value' #NEWLINE# #UNINDENT# return Response ( res ) #NEWLINE# #UNINDENT# #UNINDENT# rules = [ Rule ( '/' , name = 'test' , handler = MyHandler ) ] #NEWLINE# app = self . _get_app ( '/' ) #NEWLINE# app . router . add ( response ) #NEWLINE# client = app . get_test_client ( ) #NEWLINE# response = client . get ( '/' ) #NEWLINE# self . assertEqual ( response . data , 'undefined' ) #NEWLINE# response = client . get ( '/' , headers = { #NEWLINE# #INDENT# 'Cookie' : '\n' . join ( response . headers . getlist ( 'Set-Cookie' ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . data , 'a datastore session value' )