From 5da024cfa5ffbd5abde5e7c9906e4674458c3ab6 Mon Sep 17 00:00:00 2001 From: yuyan0428 Date: Tue, 23 Aug 2022 10:01:08 +0000 Subject: [PATCH] Signed-off-by: yuyan0428 Signed-off-by: yuyan0428 --- src/core/testcase/testcase_manager.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/testcase/testcase_manager.py b/src/core/testcase/testcase_manager.py index a23de04..666239a 100755 --- a/src/core/testcase/testcase_manager.py +++ b/src/core/testcase/testcase_manager.py @@ -254,9 +254,18 @@ class TestCaseManager(object): data_dic = json.load(json_file) return data_dic + @classmethod + def get_hap_part_json(cls, hap_file_path): + if hap_file_path.endswith(".hap"): + json_file_path = hap_file_path.replace(".hap", ".moduleInfo") + if os.path.exists(json_file_path): + with open(json_file_path, 'r') as json_file: + data_dic = json.load(json_file) + return data_dic + @classmethod def get_part_name_test_file(cls, hap_file_path): - data_dic = cls.get_hap_json(hap_file_path) + data_dic = cls.get_hap_part_json(hap_file_path) if not data_dic: return False else: -- Gitee