File tree Expand file tree Collapse file tree 4 files changed +25
-2
lines changed
Expand file tree Collapse file tree 4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1- { "engineHash" : " a74691d " , "specHash" : " 1fdcbef" , "version" : " 1.10.0" }
1+ { "engineHash" : " 1965ba0 " , "specHash" : " 1fdcbef" , "version" : " 1.10.0" }
Original file line number Diff line number Diff line change @@ -64,7 +64,13 @@ This operation is performed by calling function `preflight_file_upload_check`.
6464See the endpoint docs at
6565[ API Reference] ( https://developer.box.com/reference/options-files-content/ ) .
6666
67- _ Currently we don't have an example for calling ` preflight_file_upload_check ` in integration tests_
67+ <!-- sample options_files_content -->
68+
69+ ``` python
70+ client.uploads.preflight_file_upload_check(
71+ name = new_file_name, size = 1024 * 1024 , parent = PreflightFileUploadCheckParent(id = " 0" )
72+ )
73+ ```
6874
6975### Arguments
7076
Original file line number Diff line number Diff line change 5050
5151from box_sdk_gen .internal .utils import date_time_from_string
5252
53+ from box_sdk_gen .internal .utils import delay_in_seconds
54+
5355from test .commons import get_default_client
5456
5557from box_sdk_gen .schemas .metadata_field_filter_date_range import (
@@ -128,6 +130,7 @@ def testCreateMetaDataQueryExecuteRead():
128130 )
129131 assert metadata .template == template_key
130132 assert metadata .scope == template .scope
133+ delay_in_seconds (5 )
131134 search_from : str = '' .join ([template .scope , '.' , template .template_key ])
132135 query : MetadataQueryResults = client .search .search_by_metadata_query (
133136 search_from ,
Original file line number Diff line number Diff line change 1010
1111from box_sdk_gen .managers .uploads import UploadFileVersionAttributes
1212
13+ from box_sdk_gen .schemas .upload_url import UploadUrl
14+
15+ from box_sdk_gen .managers .uploads import PreflightFileUploadCheckParent
16+
1317from box_sdk_gen .internal .utils import get_uuid
1418
1519from box_sdk_gen .internal .utils import generate_byte_stream
@@ -42,3 +46,13 @@ def testUploadFileAndFileVersion():
4246 new_file_version : FileFull = uploaded_files_version .entries [0 ]
4347 assert new_file_version .name == new_file_version_name
4448 client .files .delete_file_by_id (new_file_version .id )
49+
50+
51+ def testPreflightCheck ():
52+ new_file_name : str = get_uuid ()
53+ preflight_check_result : UploadUrl = client .uploads .preflight_file_upload_check (
54+ name = new_file_name ,
55+ size = 1024 * 1024 ,
56+ parent = PreflightFileUploadCheckParent (id = '0' ),
57+ )
58+ assert not preflight_check_result .upload_url == ''
You can’t perform that action at this time.
0 commit comments