本文整理汇总了Python中pyuploadcare.ucare_cli.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_change_upload_base
def test_change_upload_base(self, request):
request.return_value = MockListResponse()
main(arg_namespace(
'--upload_base https://uploadcare.com/upload/ list_files'))
self.assertEqual(conf.upload_base, 'https://uploadcare.com/upload/')
开发者ID:zerc,项目名称:pyuploadcare,代码行数:7,代码来源:test_ucare_cli.py
示例2: test_change_verify_upload_ssl
def test_change_verify_upload_ssl(self, request):
request.return_value = MockListResponse()
main(arg_namespace('list'))
self.assertTrue(conf.verify_upload_ssl)
main(arg_namespace('--no_check_upload_certificate list'))
self.assertFalse(conf.verify_upload_ssl)
开发者ID:un33k,项目名称:pyuploadcare,代码行数:8,代码来源:test_ucare_cli.py
示例3: test_change_verify_api_ssl
def test_change_verify_api_ssl(self, request):
request.return_value = MockResponse(status=200)
main(arg_namespace('list'))
self.assertTrue(conf.verify_api_ssl)
main(arg_namespace('--no_check_api_certificate list'))
self.assertFalse(conf.verify_api_ssl)
开发者ID:Didacti,项目名称:tornadopyuploadcare,代码行数:8,代码来源:test_ucare_cli.py
示例4: test_calling_without_params
def test_calling_without_params(self, GroupList, pprint):
instance = self.make_group_list(GroupList)
main(arg_namespace('list_groups'))
GroupList.assert_called_once_with(
starting_point=None,
ordering=None,
limit=100,
request_limit=100
)
pprint.assert_called_once_with(list(instance))
开发者ID:zerc,项目名称:pyuploadcare,代码行数:11,代码来源:test_ucare_cli.py
示例5: test_load_verify_api_ssl_false_value_from_config
def test_load_verify_api_ssl_false_value_from_config(self, request):
request.return_value = MockResponse(status=200)
self.tmp_config_file.write(
'[ucare]\n'
'verify_api_ssl = false'
)
self.tmp_config_file.close()
main(arg_namespace('list'), [self.tmp_config_file.name])
self.assertFalse(conf.verify_api_ssl)
开发者ID:Didacti,项目名称:tornadopyuploadcare,代码行数:12,代码来源:test_ucare_cli.py
示例6: test_use_pub_key_from_config_file
def test_use_pub_key_from_config_file(self, request):
request.return_value = MockListResponse()
self.tmp_config_file.write(
'[ucare]\n'
'pub_key = demopublickey'
)
self.tmp_config_file.close()
main(arg_namespace('list'), [self.tmp_config_file.name])
self.assertEqual(conf.pub_key, 'demopublickey')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:12,代码来源:test_ucare_cli.py
示例7: test_redefine_config_pub_key_by_args
def test_redefine_config_pub_key_by_args(self, request):
request.return_value = MockListResponse()
self.tmp_config_file.write(
'[ucare]\n'
'pub_key = demopublickey'
)
self.tmp_config_file.close()
main(arg_namespace('--pub_key pub list'), [self.tmp_config_file.name])
self.assertEqual(conf.pub_key, 'pub')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:12,代码来源:test_ucare_cli.py
示例8: test_load_verify_api_ssl_true_value_from_config
def test_load_verify_api_ssl_true_value_from_config(self, request):
request.return_value = MockListResponse()
self.tmp_config_file.write(
'[ucare]\n'
'verify_api_ssl = true'
)
self.tmp_config_file.close()
main(arg_namespace('list'), [self.tmp_config_file.name])
self.assertTrue(conf.verify_api_ssl)
开发者ID:un33k,项目名称:pyuploadcare,代码行数:12,代码来源:test_ucare_cli.py
示例9: test_redefine_config_verify_api_ssl_by_args
def test_redefine_config_verify_api_ssl_by_args(self, request):
request.return_value = MockListResponse()
self.tmp_config_file.write(
'[ucare]\n'
'verify_api_ssl = true'
)
self.tmp_config_file.close()
main(arg_namespace('--no_check_api_certificate list'),
[self.tmp_config_file.name])
self.assertFalse(conf.verify_api_ssl)
开发者ID:un33k,项目名称:pyuploadcare,代码行数:13,代码来源:test_ucare_cli.py
示例10: test_calling_with_params
def test_calling_with_params(self, GroupList, pprint):
instance = self.make_group_list(GroupList)
main(arg_namespace('list_groups '
'--starting_point=2015-10-21 '
'--ordering=-datetime_created '
'--limit 10 '
'--request_limit 5'))
GroupList.assert_called_once_with(
starting_point=parser.parse('2015-10-21'),
ordering='-datetime_created',
limit=10,
request_limit=5
)
pprint.assert_called_once_with(list(instance))
开发者ID:zerc,项目名称:pyuploadcare,代码行数:15,代码来源:test_ucare_cli.py
示例11: test_use_available_pub_key_from_config_files
def test_use_available_pub_key_from_config_files(self, request):
request.return_value = MockListResponse()
self.tmp_config_file.write(
'[ucare]\n'
'pub_key = demopublickey'
)
self.tmp_config_file.close()
second_tmp_conf_file = NamedTemporaryFile(mode='w+t', delete=False)
second_tmp_conf_file.write(
'[ucare]\n'
'secret = demosecretkey'
)
second_tmp_conf_file.close()
main(arg_namespace('list'),
[self.tmp_config_file.name, second_tmp_conf_file.name])
self.assertEqual(conf.pub_key, 'demopublickey')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:20,代码来源:test_ucare_cli.py
示例12: test_redefine_pub_key_by_second_config_file
def test_redefine_pub_key_by_second_config_file(self, request):
request.return_value = MockResponse(status=200)
self.tmp_config_file.write(
'[ucare]\n'
'pub_key = demopublickey'
)
self.tmp_config_file.close()
second_tmp_conf_file = NamedTemporaryFile(mode='w+t', delete=False)
second_tmp_conf_file.write(
'[ucare]\n'
'pub_key = demopublickey_modified'
)
second_tmp_conf_file.close()
main(arg_namespace('list'),
[self.tmp_config_file.name, second_tmp_conf_file.name])
self.assertEqual(conf.pub_key, 'demopublickey_modified')
开发者ID:Didacti,项目名称:tornadopyuploadcare,代码行数:20,代码来源:test_ucare_cli.py
示例13: test_change_secret
def test_change_secret(self, request):
request.return_value = MockListResponse()
main(arg_namespace('--secret demosecretkey list'))
self.assertEqual(conf.secret, 'demosecretkey')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:6,代码来源:test_ucare_cli.py
示例14: test_empty_result
def test_empty_result(self, GroupList, pprint):
instance = self.make_group_list(GroupList, list_groups=[])
main(arg_namespace('list_groups'))
self.assertTrue(GroupList.called)
pprint.assert_called_once_with(list(instance))
开发者ID:zerc,项目名称:pyuploadcare,代码行数:5,代码来源:test_ucare_cli.py
示例15: test_change_api_version
def test_change_api_version(self, request):
request.return_value = MockListResponse()
main(arg_namespace('--api_version 0.777 list'))
self.assertEqual(conf.api_version, '0.777')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:6,代码来源:test_ucare_cli.py
示例16: test_change_pub_key
def test_change_pub_key(self, request):
request.return_value = MockListResponse()
main(arg_namespace('--pub_key demopublickey list'))
self.assertEqual(conf.pub_key, 'demopublickey')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:6,代码来源:test_ucare_cli.py
示例17: test_change_api_base
def test_change_api_base(self, request):
request.return_value = MockListResponse()
main(arg_namespace('--api_base https://uploadcare.com/api/ list'))
self.assertEqual(conf.api_base, 'https://uploadcare.com/api/')
开发者ID:un33k,项目名称:pyuploadcare,代码行数:6,代码来源:test_ucare_cli.py
注:本文中的pyuploadcare.ucare_cli.main函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论