本文整理汇总了Python中pyuploadcare.api_resources.FileGroup.create方法的典型用法代码示例。如果您正苦于以下问题:Python FileGroup.create方法的具体用法?Python FileGroup.create怎么用?Python FileGroup.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyuploadcare.api_resources.FileGroup
的用法示例。
在下文中一共展示了FileGroup.create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_group_successfully_created
# 需要导入模块: from pyuploadcare.api_resources import FileGroup [as 别名]
# 或者: from pyuploadcare.api_resources.FileGroup import create [as 别名]
def test_group_successfully_created(self, request):
json_response = b"""{
"id": "0513dda0-582f-447d-846f-096e5df9e2bb~1",
"files_count": 1,
"files": [
{"uuid": "0cea5a61-f976-47d9-815a-e787f52aeba1"}
]
}
"""
request.return_value = MockResponse(status=200, data=json_response)
files = (File("0cea5a61-f976-47d9-815a-e787f52aeba1"),)
group = FileGroup.create(files)
self.assertIsInstance(group, FileGroup)
self.assertEqual(len(group), 1)
self.assertEqual(group[0].uuid, "0cea5a61-f976-47d9-815a-e787f52aeba1")
示例2: create_file_group
# 需要导入模块: from pyuploadcare.api_resources import FileGroup [as 别名]
# 或者: from pyuploadcare.api_resources.FileGroup import create [as 别名]
def create_file_group(files_qty=1):
files = [upload_tmp_txt_file() for file_ in range(files_qty)]
group = FileGroup.create(files)
return group
示例3: test_successful_create
# 需要导入模块: from pyuploadcare.api_resources import FileGroup [as 别名]
# 或者: from pyuploadcare.api_resources.FileGroup import create [as 别名]
def test_successful_create(self):
files = [
upload_tmp_txt_file(content='пока'),
]
group = FileGroup.create(files)
self.assertIsInstance(group, FileGroup)
示例4: create_group
# 需要导入模块: from pyuploadcare.api_resources import FileGroup [as 别名]
# 或者: from pyuploadcare.api_resources.FileGroup import create [as 别名]
def create_group(arg_namespace):
files = [File(uuid) for uuid in arg_namespace.paths]
group = FileGroup.create(files)
pprint(group.info())