Skip to content

Commit 1542cd3

Browse files
committed
modify upload_file for travis test
1 parent f4ef4c6 commit 1542cd3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

qcloud_cos/test.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
ACCESS_ID = os.environ["ACCESS_ID"]
1212
ACCESS_KEY = os.environ["ACCESS_KEY"]
13-
test_bucket = "test01"
13+
test_bucket = "testbucket"
1414
test_object = "test.txt"
1515
special_file_name = "中文" + "→↓←→↖↗↙↘! \"#$%&'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
1616
conf = CosConfig(
@@ -541,15 +541,16 @@ def test_list_multipart_uploads():
541541
)
542542

543543

544-
def _test_upload_file_multithreading():
544+
def test_upload_file_multithreading():
545545
"""根据文件大小自动选择分块大小,多线程并发上传提高上传速度"""
546-
file_name = "thread_100MB"
547-
gen_file(file_name, 100)
546+
file_name = "thread_1GB"
547+
gen_file(file_name, 12) # set 12MB beacuse travis too slow
548548
st = time.time() # 记录开始时间
549549
response = client.upload_file(
550550
Bucket=test_bucket,
551551
Key=file_name,
552552
LocalFilePath=file_name,
553+
MAXThread=10,
553554
CacheControl='no-cache',
554555
ContentDisposition='download.txt'
555556
)
@@ -564,5 +565,5 @@ def _test_upload_file_multithreading():
564565
test_put_get_versioning()
565566
test_put_get_delete_replication()
566567
test_upload_part_copy()
567-
_test_upload_file_multithreading()
568+
test_upload_file_multithreading()
568569
tearDown()

0 commit comments

Comments
 (0)