提交 792f2e5c 编写于 作者: 1 15829070344 提交者: 何海涛

fixed b884779e from https://gitee.com/murphy1984/acts/pulls/6387

【上传下载】FA模型用例优化
Signed-off-by: N15829070344 <hehaitao5@huawei.com>
Change-Id: Idbde8dd04401ca70f74b481d50afb573ed7e5f5c
...@@ -18,7 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from " ...@@ -18,7 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
export default function requestSystemJSUnit() { export default function requestSystemJSUnit() {
describe('requestSystemJSUnit', function () { describe('requestSystemJSUnit', function () {
console.info('****************start requestSystemTest*****************') console.info('====>****************start requestSystemTest*****************')
/** /**
* @tc.name: ohos.SUB_REQUESTSYSTEM_UPLOAD_API_0001 * @tc.name: ohos.SUB_REQUESTSYSTEM_UPLOAD_API_0001
...@@ -28,7 +28,7 @@ export default function requestSystemJSUnit() { ...@@ -28,7 +28,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_UPLOAD_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_UPLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------");
let UploadResponse = { let UploadResponse = {
code: 200, code: 200,
data: '', data: '',
...@@ -52,23 +52,23 @@ export default function requestSystemJSUnit() { ...@@ -52,23 +52,23 @@ export default function requestSystemJSUnit() {
}, },
], ],
success: function(UploadResponse) { success: function(UploadResponse) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail'); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete'); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete');
} }
} }
try{ try{
let result = request.upload(UploadRequestOptions); let result = request.upload(UploadRequestOptions);
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result);
expect(true).assertEqual(true); expect(true).assertEqual(true);
}catch(err){ }catch(err){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err); console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err);
} }
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------");
done(); done();
}); });
...@@ -80,7 +80,7 @@ export default function requestSystemJSUnit() { ...@@ -80,7 +80,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------");
let DownloadResponse = { let DownloadResponse = {
token: "Hm_lpvt_1d6c34c1bc067f5746a5fca18d1c24ab" token: "Hm_lpvt_1d6c34c1bc067f5746a5fca18d1c24ab"
} }
...@@ -91,23 +91,23 @@ export default function requestSystemJSUnit() { ...@@ -91,23 +91,23 @@ export default function requestSystemJSUnit() {
header: '', header: '',
description: 'this is requeSystem download response', description: 'this is requeSystem download response',
success: function(DownloadResponse) { success: function(DownloadResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete');
} }
} }
try{ try{
let result = request.download(DownloadRequestOptions); let result = request.download(DownloadRequestOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result);
expect(result == null).assertEqual(true); expect(result == null).assertEqual(true);
}catch(err){ }catch(err){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err); console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err);
} }
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------");
done(); done();
}); });
...@@ -119,27 +119,27 @@ export default function requestSystemJSUnit() { ...@@ -119,27 +119,27 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1 * @tc.level: Level 1
*/ */
it('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001', 0, async function (done) { it('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------");
let OnDownloadCompleteResponse = { let OnDownloadCompleteResponse = {
uri: "http://www.path.com" uri: "http://www.path.com"
} }
let OnDownloadCompleteOptions = { let OnDownloadCompleteOptions = {
token: 'token-index', token: 'token-index',
success: function(OnDownloadCompleteResponse) { success: function(OnDownloadCompleteResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:' console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:'
+ OnDownloadCompleteResponse.uri); + OnDownloadCompleteResponse.uri);
}, },
fail: function(data, code) { fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail');
}, },
complete: function (){ complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete'); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete');
} }
} }
let result = request.onDownloadComplete(OnDownloadCompleteOptions); let result = request.onDownloadComplete(OnDownloadCompleteOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result); console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result);
expect(result == null).assertEqual(true); expect(result == null).assertEqual(true);
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------"); console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------");
done(); done();
}); });
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部