本文整理汇总了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)