提交 c1cdf8c9 编写于 作者: L lihao

update

Signed-off-by: Nlihao <lihao334@huawei.com>
上级 80f5ffa9
......@@ -287,7 +287,7 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_isSimActive_Async_0700';
sim.isSimActive(env.SLOTID2, (err, data) => {
console.info("isSimActive async err info :" + JSON.stringify(err) + "data:" + JSON.stringify(data));
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
done();
});
});
......@@ -307,7 +307,7 @@ describe('SimManagerTest', function () {
done();
}).catch(err => {
console.info("isSimActive promise err info :" + JSON.stringify(err));
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
done();
});
});
......@@ -322,7 +322,7 @@ describe('SimManagerTest', function () {
const CASE_NAME = 'Telephony_Sim_hasSimCard_Async_0600';
sim.hasSimCard(env.SLOTID2, (err, data) => {
if (err) {
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
console.info(`${CASE_NAME} fail, err: ${err.message}`);
done();
return;
......@@ -342,7 +342,7 @@ describe('SimManagerTest', function () {
try {
let data = await sim.hasSimCard(env.SLOTID2);
} catch (err) {
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
console.info(`${CASE_NAME} fail, err: ${err.message}`);
done();
return;
......@@ -374,7 +374,7 @@ describe('SimManagerTest', function () {
sim.getCardType(env.SLOTID2, (err, cardType) => {
if (err) {
console.info(`${CASE_NAME} GetCardType error: ${err.message}`);
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
done();
return;
}
......@@ -395,7 +395,7 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} test finish.`);
} catch (err) {
console.info(`${CASE_NAME} GetCardType error: ${err.message}`);
expect(err.code).assertEqual("202");
expect(err.code).assertEqual(202);
}
done();
});
......@@ -411,7 +411,7 @@ describe('SimManagerTest', function () {
sim.hasOperatorPrivileges(env.SLOTID2, (error, result) => {
if (error) {
console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
expect().assertFail();
expect(error.code).assertEqual(202);
done();
return;
}
......@@ -435,10 +435,81 @@ describe('SimManagerTest', function () {
console.info(`${CASE_NAME} test finish.`);
} catch (error) {
console.info(`${CASE_NAME} hasOperatorPrivileges error: ${error.message}`);
expect().assertFail();
expect(error.code).assertEqual(202);
}
done();
});
/**
* @tc.number Telephony_Sim_getOpKey_CallBack_0100
* @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched.
*/
it('Telephony_Sim_getOpKey_CallBack_0100', 0, async function (done) {
sim.getOpKey(0, (err, data) => {
console.info("Telephony_Sim_getOpKey_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data));
if(err){
expect(err.code).assertEqual(-1);
done();
return;
}
done();
});
});
/**
* @tc.number Telephony_Sim_getOpKey_Promise_0100
* @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched.
*/
it('Telephony_Sim_getOpKey_Promise_0100', 0, async function (done) {
let promise = sim.getOpKey(0);
promise.then(data => {
console.info("Telephony_Sim_getOpKey_Promise_0100 data = " + JSON.stringify(data));
done();
}).catch(err => {
console.info("Telephony_Sim_getOpKey_Promise_0100 err = " + JSON.stringify(err));
expect(err.code).assertEqual(-1);
done();
});
});
/**
* @tc.number Telephony_Sim_getOpName_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched.
*/
it('Telephony_Sim_getOpName_CallBack_0100', 0, async function (done) {
sim.getOpName(0, (err, data) => {
console.info("Telephony_Sim_getOpName_CallBack_0100 err = " + JSON.stringify(err) + " data = " + JSON.stringify(data));
if(err){
expect(err.code).assertEqual(-1);
done();
return;
}
done();
});
});
/**
* @tc.number Telephony_Sim_getOpName_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched.
*/
it('Telephony_Sim_getOpName_Promise_0100', 0, async function (done) {
let promise = sim.getOpName(0);
promise.then(data => {
console.info("Telephony_Sim_getOpName_Promise_0100 data = " + JSON.stringify(data));
done();
}).catch(err => {
console.info("Telephony_Sim_getOpName_Promise_0100 err = " + JSON.stringify(err));
expect(err.code).assertEqual(-1);
done();
});
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册