當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。