#NEWLINE# def test_session_fragment_query_string( self ) : #NEWLINE# #INDENT# qs = testlib . randdict ( 5 ) #NEWLINE# query_string = urlfetch . urlencode ( qs ) #NEWLINE# cookiepair = ( testlib . randstr ( ) , testlib . randstr ( ) ) #NEWLINE# headerpair = ( testlib . randstr ( ) , testlib . randstr ( ) ) #NEWLINE# s = urlfetch . Session ( headers = dict ( ( headerpair , ) ) , cookies = dict ( ( cookiepair , ) ) ) #NEWLINE# r = s . get ( testlib . url ( ) ) #NEWLINE# o = json . loads ( r . text ) #NEWLINE# self . assertEqual ( r . status , 200 ) #NEWLINE# self . assertTrue ( isinstance ( r . json , dict ) ) #NEWLINE# self . assertTrue ( isinstance ( r . text , urlfetch . unicode ) ) #NEWLINE# self . assertEqual ( o [ 'method' ] , 'GET' ) #NEWLINE# self . assertEqual ( r . reqheaders [ headerpair [ 0 ] ] , headerpair [ 1 ] ) #NEWLINE# self . assertEqual ( r . reqheaders [ 'Cookie' ] , '=' . join ( cookiepair ) ) #NEWLINE# r = s . get ( testlib . url ( ( ( '?' + query_string ) + '#urlfetch' ) ) ) #NEWLINE# o = json . loads ( r . text ) #NEWLINE# self . assertEqual ( r . status , 200 ) #NEWLINE# self . assertTrue ( isinstance ( r . json , dict ) ) #NEWLINE# self . assertTrue ( isinstance ( r . text , urlfetch . unicode ) ) #NEWLINE# self . assertEqual ( o [ 'method' ] , 'GET' ) #NEWLINE# self . assertEqual ( r . reqheaders [ headerpair [ 0 ] ] , headerpair [ 1 ] ) #NEWLINE# self . assertEqual ( r . reqheaders [ 'Cookie' ] , '=' . join ( query_string ) ) #NEWLINE# self . assertEqual ( o [ 'query_string' ] , query_string ) #NEWLINE# self . assertEqual ( o [ 'get' ] , qs )