當前位置: 首頁>>代碼示例>>Python>>正文


Python CQLClient.describe_version方法代碼示例

本文整理匯總了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')
開發者ID:bmuller,項目名稱:silverberg,代碼行數:10,代碼來源:test_client.py

示例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')
開發者ID:bmuller,項目名稱:silverberg,代碼行數:10,代碼來源:test_client.py

示例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()
開發者ID:riltsken,項目名稱:silverberg,代碼行數:10,代碼來源:test_client.py

示例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)
開發者ID:bmuller,項目名稱:silverberg,代碼行數:15,代碼來源:test_client.py


注:本文中的silverberg.client.CQLClient.describe_version方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。