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)
I added a simple test script for this to QRT - https:/ /git.launchpad. net/qa- regression- testing/ commit/ ?id=c3a8b84664b 4e90adf88064c90 903c8520af7945 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. NamedTemporaryF ile().name Client( cookies= MozillaCookieJa r(cookiefile) ) cookies. set_cookie( _utils. cookie( name="foo" ,
value= "bar",
url= "https:/ /ubuntu. com/")) cookies. save() cookiefile)
client = httpbakery.
client.
client.
os.unlink(