本文整理匯總了Python中rest_framework.status.HTTP_413_REQUEST_ENTITY_TOO_LARGE屬性的典型用法代碼示例。如果您正苦於以下問題:Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE屬性的具體用法?Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE怎麽用?Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類rest_framework.status
的用法示例。
在下文中一共展示了status.HTTP_413_REQUEST_ENTITY_TOO_LARGE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_channel_uint8_get_too_big
# 需要導入模塊: from rest_framework import status [as 別名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 別名]
def test_channel_uint8_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/channel1/0/0:2048/0:2048/0:131/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='channel2',
resolution='0', x_range='0:2048', y_range='0:2048', z_range='0:131', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)
示例2: test_channel_uint16_get_too_big
# 需要導入模塊: from rest_framework import status [as 別名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 別名]
def test_channel_uint16_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/channel2/0/0:100000/0:100000/0:10000/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='channel2',
resolution='0', x_range='0:100000', y_range='0:100000', z_range='0:10000', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)
示例3: test_channel_uint64_get_too_big
# 需要導入模塊: from rest_framework import status [as 別名]
# 或者: from rest_framework.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE [as 別名]
def test_channel_uint64_get_too_big(self):
""" Test getting a cutout that is over 1GB uncompressed"""
# Create request
factory = APIRequestFactory()
# Create Request to get data you posted
request = factory.get('/' + version + '/cutout/col1/exp1/layer1/0/0:2048/0:2048/0:66/',
accepts='application/blosc')
# log in user
force_authenticate(request, user=self.user)
# Make request
response = Cutout.as_view()(request, collection='col1', experiment='exp1', channel='layer1',
resolution='0', x_range='0:2048', y_range='0:2048', z_range='0:66', t_range=None)
self.assertEqual(response.status_code, status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)