Pool -> _Pool

This commit is contained in:
Mike Dirolf 2010-07-27 16:36:12 -04:00
parent a264d75483
commit 7a2b5259da
2 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ def _parse_uri(uri, default_port):
return (host_list, database, username, password)
class Pool(threading.local):
class _Pool(threading.local):
"""A simple connection pool.
Uses thread-local socket per thread. By calling return_socket() a
@ -276,7 +276,7 @@ class Connection(object): # TODO support auth for pooling
self.__cursor_manager = CursorManager(self)
self.__pool = Pool(self.__connect)
self.__pool = _Pool(self.__connect)
self.__network_timeout = network_timeout
self.__document_class = document_class
@ -513,7 +513,7 @@ class Connection(object): # TODO support auth for pooling
.. seealso:: :meth:`end_request`
.. versionadded:: 1.3
"""
self.__pool = Pool(self.__connect)
self.__pool = _Pool(self.__connect)
self.__host = None
self.__port = None

View File

@ -24,7 +24,7 @@ sys.path[0:0] = [""]
from nose.plugins.skip import SkipTest
from pymongo.connection import Pool
from pymongo.connection import _Pool
from test_connection import get_connection
N = 50
@ -141,13 +141,13 @@ class TestPooling(unittest.TestCase):
run_cases(self, [SaveAndFind, Disconnect, Unique])
def test_independent_pools(self):
p = Pool(None)
p = _Pool(None)
self.assertEqual([], p.sockets)
self.c.end_request()
self.assertEqual([], p.sockets)
# Sensical values aren't really important here
p1 = Pool(5)
p1 = _Pool(5)
self.assertEqual(None, p.socket_factory)
self.assertEqual(5, p1.socket_factory)