#NEWLINE# def test_deserialize_response_new( self ) : #NEWLINE# #INDENT# 'This adheres to the correct cassette specification.' #NEWLINE# s = { #NEWLINE# #INDENT# 'body' : { #NEWLINE# #INDENT# 'string' : decode ( 'foo' ) , #NEWLINE# 'encoding' : 'utf-8' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'headers' : { #NEWLINE# #INDENT# 'Content-Type' : [ decode ( 'application/json' ) ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'url' : 'http://example.com/' , #NEWLINE# 'status' : { #NEWLINE# #INDENT# 'code' : 200 , #NEWLINE# 'message' : 'OK' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'recorded_at' : '2013-08-31T00:00:01' , #NEWLINE# #UNINDENT# } #NEWLINE# r = util . deserialize_response ( s ) #NEWLINE# assert ( r . content == b'foo' ) #NEWLINE# assert ( r . encoding == 'utf-8' ) #NEWLINE# assert ( r . headers == { #NEWLINE# #INDENT# 'Content-Type' : 'application/json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( r . url == 'http://example.com/' ) #NEWLINE# assert ( r . status_code == 200 ) #NEWLINE# assert ( r . reason == 'OK' )