'L{CookieAgent} is able to handle secure cookies, ie cookies which
should only be handled over https.'

def test_secureCookie(self):

    uri = 'https://example.com:1234/foo?bar'
    cookie = 'foo=1;secure'
    cookieJar = cookielib.CookieJar()
    self.addCookies(cookieJar, uri, [cookie])
    self.assertEqual(len(list(cookieJar)), 1)
    agent = self.buildAgentForWrapperTest(self.reactor)
    cookieAgent = client.CookieAgent(agent, cookieJar)
    cookieAgent.request('GET', uri)
    (req, res) = self.protocol.requests.pop()
    self.assertEqual(req.headers.getRawHeaders('cookie'), ['foo=1'])
