#NEWLINE# def test_response_cookies( self ) : #NEWLINE# #INDENT# resp = Response ( ) #NEWLINE# self . assertEqual ( resp . cookies , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( str ( resp . cookies ) , '' ) #NEWLINE# resp . set_cookie ( 'name' , 'value' ) #NEWLINE# self . assertEqual ( str ( resp . cookies ) , 'Set-Cookie: name=value' ) #NEWLINE# resp . set_cookie ( 'name' , 'other_value' ) #NEWLINE# self . assertEqual ( str ( self . cookies ) , 'Set-Cookie: name=other_value' ) #NEWLINE# resp . cookies [ 'name' ] = 'another_other_value' #NEWLINE# resp . cookies [ 'name' ] [ 'max-age' ] = 10 #NEWLINE# self . assertEqual ( str ( resp . cookies ) , 'Set-Cookie: name=another_other_value; Max-Age=10' ) #NEWLINE# resp . del_cookie ( 'name' ) #NEWLINE# self . assertEqual ( str ( resp . cookies ) , 'Set-Cookie: name=; Max-Age=0' ) #NEWLINE# resp . set_cookie ( 'name' , 'value' , domain = 'local.host' ) #NEWLINE# self . assertEqual ( str ( resp . cookies ) , 'Set-Cookie: name=value; Domain=local.host' )