From 2464647c301cdb76cc3353ff200c81edea6f5a2d Mon Sep 17 00:00:00 2001 From: zhangyushuai Date: Fri, 2 Jun 2023 02:25:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eupload=E7=94=A8=E4=BE=8B=2000?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangyushuai --- .../src/main/ets/test/requestUpload.test.ets | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets b/request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets index 9271190fa..d9bbcb32c 100644 --- a/request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets +++ b/request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets @@ -321,5 +321,79 @@ export default function requestUploadJSUnit() { expect(true).assertFail(true); } }); + + /** + * @tc.number : SUB_REQUEST_UPLOAD_API_0007 + * @tc.name : Use getEntries get the value by mixing the string key + * @tc.desc : Mixed strings value can be obtained correctly + * @tc.size : MediumTest + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_REQUEST_UPLOAD_API_0007', 0, async function (done) { + console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_0007 is starting-----------------------"); + try { + console.info("====>SUB_REQUEST_UPLOAD_API_0007 UploadConfig = " + JSON.stringify(uploadConfig)); + request.upload(uploadConfig).then((uploadTask) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0007 uploadTask = " + uploadTask); + expect(true).assertEqual((uploadTask != undefined)); + uploadTask.on('complete', (taskStates) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0007 on_complete" ); + }); + + uploadTask.off('complete', (taskStates) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0007 off_complete"); + }); + + uploadTask.remove().then((result)=>{ + console.info("====>SUB_REQUEST_UPLOAD_API_0007 remove result = " + result); + expect(result).assertEqual(true); + console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_0007 end-----------------------"); + done(); + }); + }); + } catch (e) { + console.error("====>SUB_REQUEST_UPLOAD_API_0007 error: " + JSON.stringify(e)); + expect().assertFail(); + } + }); + + + /** + * @tc.number : SUB_REQUEST_UPLOAD_API_0008 + * @tc.name : Use getEntries get the value by mixing the string key + * @tc.desc : Mixed strings value can be obtained correctly + * @tc.size : MediumTest + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_REQUEST_UPLOAD_API_0008', 0, async function (done) { + console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_0008 is starting-----------------------"); + try { + console.info("====>SUB_REQUEST_UPLOAD_API_0008 UploadConfig = " + JSON.stringify(uploadConfig)); + request.upload(uploadConfig).then((uploadTask) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0008 uploadTask = " + uploadTask); + expect(true).assertEqual((uploadTask != undefined)); + uploadTask.on('fail', (taskStates) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0008 on_fail"); + }); + + uploadTask.off('fail', (taskStates) => { + console.info("====>SUB_REQUEST_UPLOAD_API_0008 off_fail"); + }); + + uploadTask.remove().then((result)=>{ + console.info("====>SUB_REQUEST_UPLOAD_API_0008 remove result = " + result); + expect(result).assertEqual(true); + console.info("====>-----------------------SUB_REQUEST_UPLOAD_API_0008 end-----------------------"); + done(); + }); + }); + } catch (e) { + console.error("====>SUB_REQUEST_UPLOAD_API_0008 error: " + JSON.stringify(e)); + expect().assertFail(); + } + }); + }) } -- GitLab