Commit 649516e2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Cookies class is a dict-like object


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44969 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f418a83
...@@ -205,20 +205,20 @@ class Browser(ExtendedTestBrowser): ...@@ -205,20 +205,20 @@ class Browser(ExtendedTestBrowser):
logging.info("Opening url: " + absolute_url) logging.info("Opening url: " + absolute_url)
super(Browser, self).open(absolute_url, data) super(Browser, self).open(absolute_url, data)
def getCookieValue(self, cookie_name, default=None): def getCookieValue(self, name, default=None):
""" """
Get the cookie value of the given cookie name. Get the cookie value of the given cookie name.
@param cookie_name: Name of the cookie @param name: Name of the cookie
@type cookie_name: str @type name: str
@param default: Fallback value if the cookie was not found @param default: Fallback value if the cookie was not found
@type default: str @type default: str
@return: Cookie value @return: Cookie value
@rtype: str @rtype: str
""" """
for cookie in self.cookies: for cookie_name, cookie_value in self.cookies.iteritems():
if cookie_name == cookie.name: if name == cookie_name:
return cookie.value return cookie_value
return default return default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment