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


Python FileGroup.create方法代碼示例

本文整理匯總了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")
開發者ID:uploadcare,項目名稱:pyuploadcare,代碼行數:19,代碼來源:test_api_resources.py

示例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
開發者ID:uploadcare,項目名稱:pyuploadcare,代碼行數:6,代碼來源:utils.py

示例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)
開發者ID:un33k,項目名稱:pyuploadcare,代碼行數:8,代碼來源:test_api_resources.py

示例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())
開發者ID:uploadcare,項目名稱:pyuploadcare,代碼行數:6,代碼來源:__init__.py


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