A
Ant
Hello all,
I am using urllib2 as a part of a web testing tool. One of the things I
am testing is the effect of two different people perforing the same
actions on the website - do they interfer with each other or not.
So to emulate this, I essentially have the following function:
def get_opener():
policy = cookielib.DefaultCookiePolicy(rfc2965=True)
cj = cookielib.CookieJar(policy)
return urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
Now am I right in thinking that since I am creating a separate
CookieJar for each opener, then creating two openers and using one for
each hypothetical user will achieve this effect - i.e. sessions will be
separate from each other in the app, since the openers will return
different session cookies back to the server.
Cheers,
Ant...
I am using urllib2 as a part of a web testing tool. One of the things I
am testing is the effect of two different people perforing the same
actions on the website - do they interfer with each other or not.
So to emulate this, I essentially have the following function:
def get_opener():
policy = cookielib.DefaultCookiePolicy(rfc2965=True)
cj = cookielib.CookieJar(policy)
return urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
Now am I right in thinking that since I am creating a separate
CookieJar for each opener, then creating two openers and using one for
each hypothetical user will achieve this effect - i.e. sessions will be
separate from each other in the app, since the openers will return
different session cookies back to the server.
Cheers,
Ant...