本文整理匯總了Python中pyuploadcare.api_resources.FileGroup.update_info方法的典型用法代碼示例。如果您正苦於以下問題:Python FileGroup.update_info方法的具體用法?Python FileGroup.update_info怎麽用?Python FileGroup.update_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyuploadcare.api_resources.FileGroup
的用法示例。
在下文中一共展示了FileGroup.update_info方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FileGroupAsContainerTypeTest
# 需要導入模塊: from pyuploadcare.api_resources import FileGroup [as 別名]
# 或者: from pyuploadcare.api_resources.FileGroup import update_info [as 別名]
class FileGroupAsContainerTypeTest(unittest.TestCase):
@patch('requests.sessions.Session.request', autospec=True)
def setUp(self, request):
request.return_value = MockResponse(
status=200,
data=api_response_from_file('group_files.json')
)
self.group = FileGroup(
cdn_url_or_group_id='0513dda0-582f-447d-846f-096e5df9e2bb~2'
)
# It is necessary to avoid api call in tests below.
self.group.update_info()
def test_positive_index(self):
self.assertIsInstance(self.group[0], File)
def test_negative_index(self):
self.assertIsNone(self.group[-1])
def test_index_is_out_of_range(self):
with self.assertRaises(IndexError):
self.group[2]
def test_non_int_index(self):
with self.assertRaises(TypeError):
self.group['a']
def test_iteration(self):
[file_ for file_ in self.group]
def test_slice_is_not_supported(self):
with self.assertRaises(TypeError):
self.group[0:99]
def test_len(self):
self.assertEqual(len(self.group), 2)
def test_immutability(self):
with self.assertRaises(TypeError):
self.group[0] = 123