Comment 3 for bug 1970267

Revision history for this message
Alex Murray (alexmurray) wrote :

I added a simple test script for this to QRT - https://git.launchpad.net/qa-regression-testing/commit/?id=c3a8b84664b4e90adf88064c90903c8520af7945 ie, it is enough to just do something like the following:

import tempfile
import os

from http.cookiejar import MozillaCookieJar
from macaroonbakery import httpbakery, _utils

cookiefile = tempfile.NamedTemporaryFile().name
client = httpbakery.Client(cookies=MozillaCookieJar(cookiefile))
client.cookies.set_cookie(_utils.cookie(name="foo",
                                        value="bar",
                                        url="https://ubuntu.com/"))
client.cookies.save()
os.unlink(cookiefile)