当前位置: 首页>>代码示例>>Python>>正文


Python status.HTTP_413_REQUEST_ENTITY_TOO_LARGE属性代码示例

本文整理汇总了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) 
开发者ID:jhuapl-boss,项目名称:boss,代码行数:18,代码来源:cutout_view_uint8.py

示例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) 
开发者ID:jhuapl-boss,项目名称:boss,代码行数:18,代码来源:cutout_view_uint16.py

示例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) 
开发者ID:jhuapl-boss,项目名称:boss,代码行数:18,代码来源:cutout_view_uint64.py


注:本文中的rest_framework.status.HTTP_413_REQUEST_ENTITY_TOO_LARGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。