本文整理匯總了Python中pymemcache.client.hash.HashClient._get_client方法的典型用法代碼示例。如果您正苦於以下問題:Python HashClient._get_client方法的具體用法?Python HashClient._get_client怎麽用?Python HashClient._get_client使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pymemcache.client.hash.HashClient
的用法示例。
在下文中一共展示了HashClient._get_client方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_no_servers_left_raise_exception
# 需要導入模塊: from pymemcache.client.hash import HashClient [as 別名]
# 或者: from pymemcache.client.hash.HashClient import _get_client [as 別名]
def test_no_servers_left_raise_exception(self):
from pymemcache.client.hash import HashClient
client = HashClient(
[], use_pooling=True,
ignore_exc=False,
timeout=1, connect_timeout=1
)
with pytest.raises(MemcacheError) as e:
client._get_client('foo')
assert str(e.value) == 'All servers seem to be down right now'
示例2: test_no_servers_left
# 需要導入模塊: from pymemcache.client.hash import HashClient [as 別名]
# 或者: from pymemcache.client.hash.HashClient import _get_client [as 別名]
def test_no_servers_left(self):
from pymemcache.client.hash import HashClient
client = HashClient(
[], use_pooling=True,
ignore_exc=True,
timeout=1, connect_timeout=1
)
hashed_client = client._get_client('foo')
assert hashed_client is None
示例3: _get_client
# 需要導入模塊: from pymemcache.client.hash import HashClient [as 別名]
# 或者: from pymemcache.client.hash.HashClient import _get_client [as 別名]
def _get_client(self, key):
client = HashClient._get_client(self, key)
client.default_noreply = False
return client