'Test cookies parsing and reading.'

def testCookies(self):

    httpRequest = 'GET    /    HTTP/1.0\nCookie:    rabbit="eat    carrot";    ninja=secret;    spam="hey    1=1!"\n\n'
    cookies = {}
    testcase = self
    class MyRequest(http.Request, ):
        def process(self):
            for name in ['rabbit', 'ninja', 'spam']:
                cookies[name] = self.getCookie(name)
            testcase.didRequest = True
            self.finish()
    self.runRequest(httpRequest, MyRequest)
    self.assertEqual(cookies, {'rabbit': '"eat    carrot"', 'ninja': 'secret', 'spam': '"hey    1=1!"'})
