本文整理匯總了Python中silverberg.client.CQLClient.describe_version方法的典型用法代碼示例。如果您正苦於以下問題:Python CQLClient.describe_version方法的具體用法?Python CQLClient.describe_version怎麽用?Python CQLClient.describe_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類silverberg.client.CQLClient
的用法示例。
在下文中一共展示了CQLClient.describe_version方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_describe_version
# 需要導入模塊: from silverberg.client import CQLClient [as 別名]
# 或者: from silverberg.client.CQLClient import describe_version [as 別名]
def test_describe_version(self):
"""Connect and check the version."""
client = CQLClient(self.endpoint, 'blah')
d = client.describe_version()
self.assertEqual(self.assertFired(d), '1.2.3')
self.assertEqual(self.client_proto.describe_version.call_count, 1)
self.client_proto.set_keyspace.assert_called_once_with('blah')
示例2: test_bad_keyspace
# 需要導入模塊: from silverberg.client import CQLClient [as 別名]
# 或者: from silverberg.client.CQLClient import describe_version [as 別名]
def test_bad_keyspace(self):
"""Ensure that a bad keyspace results in an errback."""
self.client_proto.set_keyspace.return_value = defer.fail(ttypes.NotFoundException())
client = CQLClient(self.endpoint, 'blah')
d = client.describe_version()
self.assertFailed(d, ttypes.NotFoundException)
self.client_proto.set_keyspace.assert_called_once_with('blah')
示例3: test_disconnect
# 需要導入模塊: from silverberg.client import CQLClient [as 別名]
# 或者: from silverberg.client.CQLClient import describe_version [as 別名]
def test_disconnect(self):
"""
When disconnect is called, the on demand thrift client is disconnected
"""
client = CQLClient(self.endpoint, 'blah')
self.assertFired(client.describe_version())
client.disconnect()
self.twisted_transport.loseConnection.assert_called_once_with()
示例4: test_login
# 需要導入模塊: from silverberg.client import CQLClient [as 別名]
# 或者: from silverberg.client.CQLClient import describe_version [as 別名]
def test_login(self):
"""Test that login works as expected."""
client = CQLClient(self.endpoint, 'blah', 'groucho', 'swordfish')
d = client.describe_version()
self.assertEqual(self.assertFired(d), '1.2.3')
self.client_proto.describe_version.assert_called_once_with()
self.client_proto.set_keyspace.assert_called_once_with('blah')
creds = {'user': 'groucho', 'password': 'swordfish'}
authreq = ttypes.AuthenticationRequest(creds)
self.client_proto.login.assert_called_once_with(authreq)