def test_secureCookie(self):
        """
        L{CookieAgent} is able to handle secure cookies, ie cookies which
        should only be handled over https.
        """
        uri = b'https://example.com:1234/foo?bar'
        cookie = b'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(b'GET', uri)

        req, res = self.protocol.requests.pop()
        self.assertEqual(req.headers.getRawHeaders(b'cookie'), [b'foo=1'])

        L{CookieAgent} is able to handle secure cookies, ie cookies which
        should only be handled over https.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_agent.py