#NEWLINE# def test_disable_compression( ) : #NEWLINE# #INDENT# s = Scraper ( ) #NEWLINE# s . disable_compression = True #NEWLINE# data = s . get ( ( HTTPBIN + 'headers' ) ) #NEWLINE# djson = data . json ( ) #NEWLINE# assert ( 'compress' not in djson [ 'headers' ] [ 'Accept-Encoding' ] ) #NEWLINE# assert ( 'gzip' not in djson [ 'headers' ] [ 'Accept-Encoding' ] ) #NEWLINE# s . disable_compression = False #NEWLINE# data = s . get ( ( HTTPBIN + 'headers' ) ) #NEWLINE# djson = data . json ( ) #NEWLINE# assert ( 'compress' in djson [ 'headers' ] [ 'Accept-Encoding' ] ) #NEWLINE# assert ( 'gzip' in djson [ 'headers' ] [ 'Accept-Encoding' ] ) #NEWLINE# s . headers [ 'Accept-Encoding' ] = 'xyz' #NEWLINE# data = s . get ( ( HTTPBIN + 'headers' ) ) #NEWLINE# djson = data . json ( ) #NEWLINE# assert ( 'xyz' in s [ 'headers' ] [ 'Accept-Encoding' ] )