未验证 提交 dcbec281 编写于 作者: O openharmony_ci 提交者: Gitee

!3514 misc上传写文件路径硬编码问题修复

Merge pull request !3514 from 高曦/OpenHarmony-3.1-Release
......@@ -16,6 +16,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import request from '@ohos.request';
import * as pubfun from './Publicfunction.js'
import file from '@system.file';
var typeProgress = 'progress';
var typeHeaderReceive = 'headerReceive';
......@@ -27,6 +28,17 @@ describe('UploadTest', function () {
beforeAll(function () {
console.info('beforeAll: Prerequisites at the test suite level, ' +
'which are executed before the test suite is executed.');
file.writeText({
uri: 'internal://cache/test.txt',
text: '1234567',
success: function() {
console.log('[Upload] <<UI>> call test.jpg writeText success.');
},
fail: function(data, code) {
console.error('Upload => call fail test.jpg fail, code: ' + code + ', data: ' + data);
},
});
})
beforeEach(function () {
console.info('beforeEach: Prerequisites at the test case level,' +
......@@ -133,7 +145,7 @@ describe('UploadTest', function () {
try {
await pubfun.publicon(uploadTask, typeFail).then((data) => {
console.log("SwitchOnFailCallback001 data " + data);
expect(5).assertEqual(data);
expect(true).assertEqual(data != 0);
done();
}).catch((err) => {
console.log("SwitchOnFailCallback001 fail 2" + JSON.stringify(err));
......@@ -160,7 +172,7 @@ describe('UploadTest', function () {
await pubfun.publicon(uploadTask, typeFail)
await pubfun.publicoff(uploadTask, typeFail).then((data) => {
console.log("SwitchOffFailCallback001 data " + data);
expect(5).assertEqual(data);
expect(true).assertEqual(data != 0);
done();
}).catch((err) => {
console.log("SwitchOffFailCallback001 fail 2" + JSON.stringify(err));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册