#NEWLINE# def assertForwardsResponse( self , request , code , message , headers , body ) : #NEWLINE# #INDENT# '\n        Assert that C{request} has forwarded a response from the server.\n\n        @param request: A L{DummyRequest}.\n        @param code: The expected HTTP response code.\n        @param message: The expected HTTP message.\n        @param headers: The expected HTTP headers.\n        @param body: The expected response body.\n        ' #NEWLINE# self . assertEquals ( request . responseCode , code ) #NEWLINE# self . assertEquals ( request . responseMessage , message ) #NEWLINE# receivedHeaders = list ( request . responseHeaders . getAllRawHeaders ( ) ) #NEWLINE# receivedHeaders . sort ( ) #NEWLINE# expectedHeaders = headers [ : ] #NEWLINE# expectedHeaders . sort ( ) #NEWLINE# self . assertEquals ( code , expectedHeaders ) #NEWLINE# self . assertEquals ( '' . join ( request . written ) , body )