Skip to content

Commit f16ce37

Browse files
committed
write 4m content
1 parent c6b8609 commit f16ce37

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

qiniu/test/resumable_io_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,20 @@ def test_put(self):
7878
rs.Client().delete(bucket, key)
7979

8080
def test_put_4m(self):
81-
src = urllib.urlopen("http://for-temp.qiniudn.com/FnIVmMd_oaUV3MLDM6F9in4RMz2U")
8281
ostype = platform.system()
8382
if ostype.lower().find("windows") != -1:
8483
tmpf = "".join([os.getcwd(), os.tmpnam()])
8584
else:
8685
tmpf = os.tmpnam()
8786
dst = open(tmpf, 'wb')
88-
shutil.copyfileobj(src, dst)
89-
src.close()
87+
dst.write("abcd" * 1024 * 1024)
88+
dst.flush()
9089

9190
policy = rs.PutPolicy(bucket)
9291
extra = resumable_io.PutExtra(bucket)
9392
extra.bucket = bucket
9493
extra.params = {"x:foo": "test"}
95-
key = "sdk_py_resumable_block_4m_%s" % r(9)
94+
key = "sdk_py_resumable_block_6_%s" % r(9)
9695
localfile = dst.name
9796
ret, err = resumable_io.put_file(policy.token(), key, localfile, extra)
9897
assert ret.get("x:foo") == "test", "return data not contains 'x:foo'"

0 commit comments

Comments
 (0)