#NEWLINE# def test_response_update_from_objects_cookies_replace( ) : #NEWLINE# #INDENT# r = http . Response ( 'HTTP/1.1 200 OK\r\nSet-Cookie: foo=bar\r\nSet-Cookie: baz=buzz\r\nHeader: out of fucking nowhere\r\nSet-Cookie: foo=buzz\r\n\r\n' ) #NEWLINE# expected_pairs = [ ( 'foo' , 'bar' ) , ( 'baz' , 'buzz' ) , ( 'foo' , 'buzz' ) ] #NEWLINE# check_response_cookies ( expected_pairs , r ) #NEWLINE# r . cookies [ 'foo' ] = http . ResponseCookie ( 'foo=banana' ) #NEWLINE# assert ( r . full_response == 'HTTP/1.1 200 OK\r\nSet-Cookie: foo=banana\r\nSet-Cookie: baz=buzz\r\nHeader: out of fucking nowhere\r\n\r\n' )