cookies: add test to check that wrapped cookiejar thread based lock is overrided

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401086
This commit is contained in:
Daniel Grana 2009-04-27 06:45:49 +00:00
parent 45f55c0df0
commit 68f54a1a63
1 changed files with 10 additions and 1 deletions

View File

@ -1100,7 +1100,7 @@ class LWPCookieTests(TestCase):
'PART_NUMBER=ROCKET_LAUNCHER_0001; NO_A_BOT; GOOD_CUSTOMER')
class WrapperRequestResponse(TestCase):
class CookielibWrappersTest(TestCase):
def FakeRequest(self, url, data='', headers={}):
tail = '?' + urllib.quote(data) if data else ''
@ -1147,4 +1147,13 @@ class WrapperRequestResponse(TestCase):
req = self.FakeRequest("http://www.acme.com:2345/resource.html", headers={"Host": "www.acme.com:5432"})
self.assertEquals(request_host(req), "www.acme.com")
def test_threadlock_override(self):
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
c = CookieJar()
assert not isinstance(c.jar._cookies_lock, _threading._RLock)