本文整理汇总了Python中prestoadmin.prestoclient.PrestoClient.rows方法的典型用法代码示例。如果您正苦于以下问题:Python PrestoClient.rows方法的具体用法?Python PrestoClient.rows怎么用?Python PrestoClient.rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prestoadmin.prestoclient.PrestoClient
的用法示例。
在下文中一共展示了PrestoClient.rows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_execute_query_get_port
# 需要导入模块: from prestoadmin.prestoclient import PrestoClient [as 别名]
# 或者: from prestoadmin.prestoclient.PrestoClient import rows [as 别名]
def test_execute_query_get_port(self, run_mock, conn_mock):
client = PrestoClient('any_host', 'any_user')
client.rows = ['hello']
client.next_uri = 'hello'
client.response_from_server = {'hello': 'hello'}
run_mock.return_value = _AttributeString('http-server.http.port=8080')
run_mock.return_value.failed = False
client.execute_query('select * from nation')
self.assertEqual(client.port, 8080)
self.assertEqual(client.rows, [])
self.assertEqual(client.next_uri, '')
self.assertEqual(client.response_from_server, {})
示例2: testrun_sql_get_port
# 需要导入模块: from prestoadmin.prestoclient import PrestoClient [as 别名]
# 或者: from prestoadmin.prestoclient.PrestoClient import rows [as 别名]
def testrun_sql_get_port(self, sudo_mock, conn_mock, mock_presto_config):
client = PrestoClient('any_host', 'any_user')
client.rows = ['hello']
client.next_uri = 'hello'
client.response_from_server = {'hello': 'hello'}
sudo_mock.return_value = _AttributeString('http-server.http.port=8080')
sudo_mock.return_value.failed = False
sudo_mock.return_value.return_code = 0
client.run_sql('select * from nation')
self.assertEqual(client.port, 8080)
self.assertEqual(client.rows, [])
self.assertEqual(client.next_uri, '')
self.assertEqual(client.response_from_server, {})