本文整理汇总了Python中test_base.print_command函数的典型用法代码示例。如果您正苦于以下问题:Python print_command函数的具体用法?Python print_command怎么用?Python print_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_command函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_list_users
def test_list_users(self):
sys.argv = ['qds.py', 'group', 'list-users', '123']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"GET", "groups/123/qbol_users", params=None)
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_group.py
示例2: test_unassign_role
def test_unassign_role(self):
sys.argv = ['qds.py', 'role', 'unassign_role', '123', "--group_id", "456"]
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_has_calls(call("PUT",
"roles/123/groups/456/unassign", params=None))
开发者ID:itsvikramagr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_role.py
示例3: test_all
def test_all(self):
sys.argv = ['qds.py', 'account', 'create',
'--name', 'new_account',
'--location', 's3://bucket/path',
'--storage-access-key', 'dummy',
'--storage-secret-key', 'dummy',
'--compute-access-key', 'dummy',
'--compute-secret-key', 'dummy',
'--previous-account-plan', 'true',
'--aws-region', 'us-east-1']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with("POST", "account", {'account': {
'name': 'new_account',
'acc_key': 'dummy',
'level': 'free',
'compute_type': 'CUSTOMER_MANAGED',
'aws_region': 'us-east-1',
'storage_type': 'CUSTOMER_MANAGED',
'CacheQuotaSizeInGB': '25',
'secret': 'dummy',
'use_previous_account_plan': 'true',
'compute_secret_key': 'dummy',
'compute_access_key': 'dummy',
'defloc': 's3://bucket/path'}})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:26,代码来源:test_account.py
示例4: test_sort_cpu
def test_sort_cpu(self):
sys.argv = ['qds.py', 'report', 'all_commands', '--sort', 'cpu']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"GET", "reports/all_commands", params={'sort_column': 'cpu'})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_report.py
示例5: test_update
def test_update(self):
sys.argv = ['qds.py', 'role', 'update', '123', '--name', 'test']
print_command()
Connection._api_call = Mock(return_value={'roles':[]})
qds.main()
Connection._api_call.assert_has_calls(call("PUT",
"roles/123", params={'name':'test'}))
开发者ID:itsvikramagr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_role.py
示例6: test_minimal
def test_minimal(self):
sys.argv = ['qds.py', '--version', 'v2', 'cluster', 'update', '123']
Qubole.cloud = None
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with('PUT', 'clusters/123', {})
开发者ID:rahul26goyal,项目名称:qds-sdk-py,代码行数:7,代码来源:test_clusterv2.py
示例7: test_state_invalid
def test_state_invalid(self):
sys.argv = ['qds.py', '--version', 'v2', 'cluster', 'list', '--state', 'invalid']
Qubole.cloud = None
print_command()
Connection._api_call = Mock(return_value=[{"cluster" : {"state" : "invalid"}}])
qds.main()
Connection._api_call.assert_called_with('GET', 'clusters', params=None)
开发者ID:rahul26goyal,项目名称:qds-sdk-py,代码行数:7,代码来源:test_clusterv2.py
示例8: test_update_two_fields
def test_update_two_fields(self):
sys.argv = ['qds.py', 'nezha', 'data_sources', 'update', '123', '--url', 'http://test', '--name', 'test']
print_command()
Connection._api_call = Mock(return_value={'nezha_data_sources': []})
qds.main()
Connection._api_call.assert_called_with(
"PUT", "nezha_data_sources/123", {'name': 'test', 'url': 'http://test'})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_nezha.py
示例9: test_update_schema_name
def test_update_schema_name(self):
sys.argv = ['qds.py', 'nezha', 'cubes', 'update', '123', '--schema_name', 'something']
print_command()
Connection._api_call = Mock(return_value={'nezha_cubes': []})
qds.main()
Connection._api_call.assert_called_with(
"PUT", "nezha_cubes/123", {'schema_name': 'something'})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_nezha.py
示例10: test_duplicate
def test_duplicate(self):
sys.argv = ['qds.py', 'group', 'duplicate', '123']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"POST", "groups/123/duplicate", {})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_group.py
示例11: test_results
def test_results(self):
sys.argv = ['qds.py', 'action', 'results', '123']
print_command()
Connection._api_call = Mock()
Connection._api_call.side_effect = common_side_effect
qds.main()
Connection._api_call.assert_has_calls([call("GET", "actions/123", params=None),call("GET", "commands/123/results", params={'inline': True})])
开发者ID:guptarajat,项目名称:qds-sdk-py,代码行数:7,代码来源:test_actions.py
示例12: test_delete_group
def test_delete_group(self):
sys.argv = ['qds.py', 'group', 'delete', '123']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"DELETE", "groups/123", None)
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_group.py
示例13: test_remove_roles
def test_remove_roles(self):
sys.argv = ['qds.py', 'group', 'remove-roles', '123', '456,789']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"PUT", "groups/123", {'removed_roles': '456,789'})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_group.py
示例14: test_list
def test_list(self):
sys.argv = ['qds.py', 'group', 'list']
print_command()
Connection._api_call = Mock(return_value={'groups': []})
qds.main()
Connection._api_call.assert_called_with(
"GET", "groups", params=None)
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_group.py
示例15: test_file_sensor
def test_file_sensor(self):
sys.argv = ['qds.py', 'filesensor', 'check', '-d', '{"files":["s3://dev.canopydata.com/airflow"]}']
print_command()
Connection._api_call = Mock(return_value={'status': True})
qds.main()
Connection._api_call.assert_called_with(
"POST", "sensors/file_sensor", {'files':['s3://dev.canopydata.com/airflow']})
开发者ID:harshshah87,项目名称:qds-sdk-py,代码行数:7,代码来源:test_sensor.py
示例16: test_partition_sensor
def test_partition_sensor(self):
sys.argv = ['qds.py', 'partitionsensor', 'check', '-d', '{"schema" : "default", "table" : "nation_s3_rcfile_p", "columns" : [{"column" : "p", "values" : [1, 2]}]}']
print_command()
Connection._api_call = Mock(return_value={'status': True})
qds.main()
Connection._api_call.assert_called_with(
"POST", "sensors/partition_sensor", {"schema" : "default", "table" : "nation_s3_rcfile_p", "columns" : [{"column" : "p", "values" : [1, 2]}]})
开发者ID:harshshah87,项目名称:qds-sdk-py,代码行数:7,代码来源:test_sensor.py
示例17: test_list_actions_seq_id
def test_list_actions_seq_id(self):
sys.argv = ['qds.py', 'scheduler', 'list-actions', '123', '--sequence_id', '123']
print_command()
Connection._api_call = Mock()
Connection._api_call.side_effect = list_actions_side_effect
qds.main()
Connection._api_call.assert_has_calls([call("GET", "scheduler/123",params=None), call("GET", "scheduler/123/actions/123", params={})])
开发者ID:guptavishal,项目名称:qds-sdk-py,代码行数:7,代码来源:test_scheduler.py
示例18: test_list_actions_pages_fields
def test_list_actions_pages_fields(self):
sys.argv = ['qds.py', 'scheduler', 'list-actions', '123', '--per-page', '2', '--fields', 'id', 'sequence_id']
print_command()
Connection._api_call = Mock()
Connection._api_call.side_effect = list_actions_side_effect
qds.main()
Connection._api_call.assert_has_calls([call("GET","scheduler/123",params=None), call("GET", "scheduler/123/actions", params={'per_page':'2'})])
开发者ID:guptavishal,项目名称:qds-sdk-py,代码行数:7,代码来源:test_scheduler.py
示例19: test_limit
def test_limit(self):
sys.argv = ['qds.py', 'report', 'all_commands', '--limit', '20']
print_command()
Connection._api_call = Mock(return_value={})
qds.main()
Connection._api_call.assert_called_with(
"GET", "reports/all_commands", params={'limit': 20})
开发者ID:adeshr,项目名称:qds-sdk-py,代码行数:7,代码来源:test_report.py
示例20: test_sparkcmd
def test_sparkcmd(self):
sys.argv = ['qds.py', 'sparkcmd', 'cancel', '123']
print_command()
Connection._api_call = Mock(return_value={'kill_succeeded': True})
qds.main()
Connection._api_call.assert_called_with("PUT", "commands/123",
{'status': 'kill'})
开发者ID:Ninelives21,项目名称:qds-sdk-py,代码行数:7,代码来源:test_command.py
注:本文中的test_base.print_command函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论