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

!8486 add assertion

Merge pull request !8486 from yanglifeng/master
......@@ -79,8 +79,13 @@ describe('kvManagerCallbackTest', function () {
console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0100');
try {
await kvManager.getKVStore(TEST_STORE_ID, options, function (err, store) {
expect((err == undefined) && (store != null)).assertTrue();
console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0100 getKVStore success');
kvStore = store;
kvStore.getSecurityLevel().then((data) => {
console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0100 securityLevel = ' + data);
expect((data == factory.SecurityLevel.S2)).assertTrue();
});
done();
});
} catch (e) {
......@@ -104,7 +109,8 @@ describe('kvManagerCallbackTest', function () {
console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0200 getKVStore success');
expect(null).assertFail();
} else {
console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0200 getKVStore fail');
expect((err.code == 401)).assertTrue();
console.info('getKVStore fail' + `, error code is ${err.code}, message is ${err.message}`);
}
done();
});
......
......@@ -82,8 +82,13 @@ describe('kvManagerCallbackTest', function () {
console.info('testKVManagerGetKVStore101');
try {
await kvManager.getKVStore(TEST_STORE_ID, options, function (err, store) {
expect((err == undefined) && (store != null)).assertTrue();
console.info('testKVManagerGetKVStore101 getKVStore success');
kvStore = store;
kvStore.getSecurityLevel().then((data) => {
console.info('testKVManagerGetKVStore101 securityLevel = ' + data);
expect((data == factory.SecurityLevel.S2)).assertTrue();
});
done();
});
} catch (e) {
......@@ -106,6 +111,7 @@ describe('kvManagerCallbackTest', function () {
console.info('testKVManagerGetKVStore102 getKVStore success');
expect(null).assertFail();
} else {
expect((err != undefined)).assertTrue();
console.info('testKVManagerGetKVStore102 getKVStore fail');
}
done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册