提交 75825a50 编写于 作者: G greada

power test code optimization

Signed-off-by: Ngreada <kangqiao1@huawei.com>
上级 979060cf
...@@ -39,7 +39,7 @@ function completeFunc(tag) { ...@@ -39,7 +39,7 @@ function completeFunc(tag) {
} }
export default function SystemBatteryTest() { export default function SystemBatteryTest() {
describe('SystemBatteryTest', function () { describe('SystemBatteryTest', function () {
console.log("*************System Battery Unit Test Begin*************"); console.log("*************System Battery Unit Test Begin*************");
/** /**
...@@ -47,8 +47,7 @@ describe('SystemBatteryTest', function () { ...@@ -47,8 +47,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_success_test * @tc.name get_status_success_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
const successTest = "get_status_success_test"; it('get_status_success_test', 0, function () {
it(successTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: (data) => { success: (data) => {
successFunc(data, successTest); successFunc(data, successTest);
...@@ -67,8 +66,7 @@ describe('SystemBatteryTest', function () { ...@@ -67,8 +66,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_success_null_test * @tc.name get_status_success_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
const successNullTest = "get_status_success_null_test"; it('get_status_success_null_test', 0, function () {
it(successNullTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: null, success: null,
fail: (data, code) => { fail: (data, code) => {
...@@ -85,8 +83,7 @@ describe('SystemBatteryTest', function () { ...@@ -85,8 +83,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_success_empty_test * @tc.name get_status_success_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
const successEmptyTest = "get_status_success_null_test"; it('get_status_success_null_test', 0, function () {
it(successEmptyTest, 0, function () {
battery.getStatus({ battery.getStatus({
fail: (data, code) => { fail: (data, code) => {
failFunc(data, code, successEmptyTest); failFunc(data, code, successEmptyTest);
...@@ -102,8 +99,7 @@ describe('SystemBatteryTest', function () { ...@@ -102,8 +99,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_fail_null_test * @tc.name get_status_fail_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
let failNullTest = "get_status_fail_null_test"; it('get_status_fail_null_test', 0, function () {
it(failNullTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: (data) => { success: (data) => {
successFunc(data, failNullTest); successFunc(data, failNullTest);
...@@ -120,8 +116,7 @@ describe('SystemBatteryTest', function () { ...@@ -120,8 +116,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_fail_empty_test * @tc.name get_status_fail_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
let failEmptyTest = "get_status_fail_empty_test"; it('get_status_fail_empty_test', 0, function () {
it(failEmptyTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: () => { success: () => {
successFunc(data, failEmptyTest); successFunc(data, failEmptyTest);
...@@ -137,8 +132,7 @@ describe('SystemBatteryTest', function () { ...@@ -137,8 +132,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_complete_null_test * @tc.name get_status_complete_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
let completeNullTest = "get_status_complete_null_test"; it('get_status_complete_null_test', 0, function () {
it(completeNullTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: (data) => { success: (data) => {
successFunc(data, completeNullTest); successFunc(data, completeNullTest);
...@@ -155,8 +149,7 @@ describe('SystemBatteryTest', function () { ...@@ -155,8 +149,7 @@ describe('SystemBatteryTest', function () {
* @tc.name get_status_complete_empty_test * @tc.name get_status_complete_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
let completeEmptyTest = "get_status_complete_empty_test"; it('get_status_complete_empty_test', 0, function () {
it(completeEmptyTest, 0, function () {
battery.getStatus({ battery.getStatus({
success: (data) => { success: (data) => {
successFunc(data, completeEmptyTest); successFunc(data, completeEmptyTest);
...@@ -192,5 +185,5 @@ describe('SystemBatteryTest', function () { ...@@ -192,5 +185,5 @@ describe('SystemBatteryTest', function () {
battery.getStatus(); battery.getStatus();
expect(!allNull).assertTrue(); expect(!allNull).assertTrue();
}); });
}) })
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册