本文整理汇总了Python中testkitlite.util.log.LOGGER.info方法的典型用法代码示例。如果您正苦于以下问题:Python LOGGER.info方法的具体用法?Python LOGGER.info怎么用?Python LOGGER.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testkitlite.util.log.LOGGER
的用法示例。
在下文中一共展示了LOGGER.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_wrt_app
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _get_wrt_app(self, test_suite, test_set, fuzzy_match, auto_iu):
test_app_id = None
if auto_iu:
test_wgt = test_set
test_wgt_path = WRT_LOCATION % (test_suite, test_wgt)
if not self.install_app(test_wgt_path):
LOGGER.info("[ failed to install widget \"%s\" in target ]"
% test_wgt)
return None
else:
test_wgt = test_suite
# check if widget installed already
cmd = WRT_QUERY_STR % (self.deviceid, test_wgt)
exit_code, ret = shell_command(cmd)
if exit_code == -1:
return None
for line in ret:
items = line.split(':')
if len(items) < 1:
continue
if (fuzzy_match and items[0].find(test_wgt) != -1) or items[0] == test_wgt:
test_app_id = items[1].strip('\r\n')
break
if test_app_id is None:
LOGGER.info("[ test widget \"%s\" not found in target ]"
% test_wgt)
return None
return test_app_id
示例2: _get_xwalk_app
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _get_xwalk_app(self, test_suite, test_set, fuzzy_match, auto_iu):
test_app_id = None
if auto_iu:
test_wgt = test_set
test_wgt_path = XWALK_LOCATION % (test_suite, test_wgt)
if not self.install_app(test_wgt_path):
LOGGER.info("[ failed to install widget \"%s\" in target ]"
% test_wgt)
return None
else:
test_wgt = test_suite
# check if widget installed already
cmd = XWALK_QUERY_STR % (self.deviceid, test_wgt)
exit_code, ret = shell_command(cmd)
if exit_code == -1:
return None
for line in ret:
test_app_id = line.strip('\r\n')
if test_app_id is None:
LOGGER.info("[ test widget \"%s\" not found in target ]"
% test_wgt)
return None
return test_app_id
示例3: _get_xwalk_app
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _get_xwalk_app(self, test_suite, test_set, fuzzy_match, auto_iu):
test_app_id = ""
if auto_iu:
test_wgt = test_set
test_wgt_path = XWALK_LOCATION % (DEEPIN_USER, test_suite, test_wgt)
if not self.install_app(test_wgt_path):
LOGGER.info("[ failed to install widget \"%s\" in target ]"
% test_wgt)
return None
else:
test_wgt = test_suite
arr = test_wgt.split('-')
for item in arr:
test_app_id += item
test_wgt = test_app_id
# check if widget installed already
cmd = XWALK_QUERY_STR % (test_wgt)
exit_code, ret = shell_command(cmd)
if exit_code == -1:
return None
# for line in ret:
# test_app_id = line.strip('\r\n')
if test_app_id is None:
LOGGER.info("[ test widget \"%s\" not found in target ]"
% test_wgt)
return None
return test_app_id
示例4: run_test
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def run_test(self, sessionid, test_set):
"""
process the execution for a test set
"""
if sessionid is None:
return False
if not "cases" in test_set:
return False
disabledlog = os.environ.get('disabledlog','')
cases, exetype, ctype = test_set[
"cases"], test_set["exetype"], test_set["type"]
#print 'exetype', exetype
if len(cases) == 0:
return False
# start debug trace thread
if disabledlog == 'True':
pass
else:
self.conn.start_debug(self.opts['debug_log_base'])
time.sleep(1)
self.result_obj = TestSetResut(
self.opts['testsuite_name'], self.opts['testset_name'])
if self.opts['test_type'] == "webapi":
if ctype == 'ref':
exetype = 'manual'
return self.__run_web_test(sessionid, self.opts['testset_name'], exetype, ctype, cases)
elif self.opts['test_type'] == "coreapi":
return self.__run_core_test(sessionid, self.opts['testset_name'], exetype, cases)
#elif self.opts['test_type'] == "jqunit":
elif self.opts['test_type'] in ["jqunit",'pyunit']:
return self.__run_jqt_test(sessionid, self.opts['testset_name'], cases)
else:
LOGGER.info("[ unsupported test suite type ! ]")
return False
示例5: _adunit_test_exec
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _adunit_test_exec(conn, test_session, test_set_path, result_obj):
"""function for running core tests"""
global result_buffer
result_buffer = result_obj
result_obj.set_status(0)
LOGGER.info('[ android unit test, entry: %s ]' % test_set_path)
test_cmd = ANDROID_UNIT_START % (test_set_path, '.'.join(test_set_path.split('.')[:-1]))
_code, _out, _error = conn.shell_cmd_ext(cmd=test_cmd, timeout=None, boutput=True, callbk=_adunit_lines_handler)
result_obj.set_status(1)
示例6: _get_user_id
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _get_user_id(self):
if TIZEN_USER.lower() == 'app':
self.port = '5000'
else:
cmdline = XWALK_QUERY_ID % (self.deviceid, TIZEN_USER)
exit_code, ret = shell_command(cmdline)
if exit_code == -1:
LOGGER.info("[ can not get user id ]")
if len(ret) > 0 :
self.port = ret[0].strip('\r\n')
示例7: get_launcher_opt
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def get_launcher_opt(self, test_launcher, test_ext, test_widget, test_suite, test_set):
"""
get test option dict
"""
test_opt = {}
test_opt["launcher"] = WIN_MAIN
LOGGER.info("[ test_ext: %s; test_widget: %s; test_suite: %s]" % (test_ext, test_widget, test_suite))
test_opt["test_app_id"] = test_suite
return test_opt
示例8: download_file
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def download_file(self, remote_path, local_path):
"""download file from device"""
cmd = "adb -s %s pull %s %s" % (self.deviceid, remote_path, local_path)
exit_code, ret = shell_command(cmd)
if exit_code != 0:
error = ret[0].strip('\r\n') if len(ret) else "sdb shell timeout"
LOGGER.info("[ Download file \"%s\" failed, error: %s ]"
% (remote_path, error))
return False
else:
return True
示例9: upload_file
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def upload_file(self, remote_path, local_path):
"""upload file to device"""
cmd = "sdb -s %s push %s %s" % (self.deviceid, local_path, remote_path)
exit_code, ret = shell_command(cmd)
if exit_code != 0:
error = ret[0].strip('\r\n') if len(ret) else "sdb shell timeout"
LOGGER.info("[ Upload file \"%s\" failed,"
" get error: %s ]" % (local_path, error))
return False
else:
return True
示例10: extend_result
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def extend_result(self, cases_result=None, print_out=True):
"""update cases result to the result buffer"""
self._mutex.acquire()
if cases_result is not None:
self._result["cases"].extend(cases_result)
if print_out:
for case_it in cases_result:
LOGGER.info(self._progress % (self._suite_name, case_it["case_id"], case_it["result"]))
if case_it["result"].lower() in ["fail", "block"] and "stdout" in case_it:
LOGGER.info(str2str(case_it["stdout"]))
self._mutex.release()
示例11: _pyunit_test_exec
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _pyunit_test_exec(test_session, test_set_path, result_obj):
"""function for running core tests"""
global result_buffer
result_buffer = result_obj
result_obj.set_status(0)
LOGGER.info('[ pyunit test: %s ]' % test_set_path)
try:
tests = unittest.TestLoader().discover(test_set_path, pattern='*test*.py')
unittest.TextTestRunner(resultclass=LiteTestResult, buffer=True).run(tests)
except ImportError as error:
pass
result_obj.set_status(1)
示例12: extend_result
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def extend_result(self, cases_result=None, print_out=True):
"""update cases result to the result buffer"""
self._mutex.acquire()
if cases_result is not None:
self._result["cases"].extend(cases_result)
if print_out:
for case_it in cases_result:
LOGGER.info(self._progress %
(self._suite_name, case_it['case_id'], case_it['result']))
if case_it['result'].lower() in ['fail', 'block'] and 'stdout' in case_it:
LOGGER.info(str2str(case_it['stdout']))
self._mutex.release()
示例13: kill_testkit_lite
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def kill_testkit_lite(pid_file):
""" kill testkit lite"""
try:
with open(pid_file, "r") as pidfile:
pid = pidfile.readline().rstrip("\n")
if pid:
killall(pid)
except IOError as error:
pattern = re.compile("No such file or directory|No such process")
match = pattern.search(str(error))
if not match:
LOGGER.info("[ Error: fail to kill existing testkit-lite, " "error: %s ]\n" % error)
return None
示例14: _webuifw_test_exec
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def _webuifw_test_exec(conn, test_web_app, test_session, test_set_name, exetype, cases_queue, result_obj):
"""function for running webuifw tests"""
global UIFW_SET_NUM
UIFW_SET_NUM = UIFW_SET_NUM + 1
set_UIFW_RESULT = UIFW_RESULT + "_" + str(UIFW_SET_NUM) +".xml"
result_obj.set_status(0)
result_obj.set_result({"resultfile": ""})
ls_cmd = "ls -l %s" % set_UIFW_RESULT
sz_cmd = "du -hk %s " % set_UIFW_RESULT
time_out = UIFW_MAX_TIME
rm_cmd = "rm /opt/usr/media/Documents/tcresult*.xml"
if exetype == "auto":
conn.shell_cmd(rm_cmd)
UIFW_SET_NUM = 1
LOGGER.info('[webuifw] start test executing')
if not conn.launch_app(test_web_app):
LOGGER.info("[ launch test app \"%s\" failed! ]" % test_web_app)
result_obj.set_result({"resultfile": ""})
result_obj.set_status(1)
result_file = FILES_ROOT + test_session + "_uifw.xml"
while time_out > 0:
LOGGER.info('[webuifw] waiting for test completed...')
exit_code, ret = conn.shell_cmd(ls_cmd)
if not 'No such file or directory' in ret[0]:
exit_code, ret = conn.shell_cmd(sz_cmd)
f_size = int(ret[0].split("\t")[0])
if f_size > 0:
break
if time_out > UIFW_MAX_WRITE_TIME:
time_out = UIFW_MAX_WRITE_TIME
time.sleep(2)
time_out -= 2
LOGGER.info('[webuifw] end test executing')
if conn.download_file(set_UIFW_RESULT, result_file):
result_obj.set_result({"resultfile": result_file})
for test_case in cases_queue:
LOGGER.info("[webuifw] execute case: %s # %s" %
(test_set_name, test_case['case_id']))
result_obj.set_status(1)
示例15: download_file
# 需要导入模块: from testkitlite.util.log import LOGGER [as 别名]
# 或者: from testkitlite.util.log.LOGGER import info [as 别名]
def download_file(self, remote_path, local_path):
"""download file from device"""
local_path_dir = os.path.dirname(local_path)
if not os.path.exists(local_path_dir):
os.makedirs(local_path_dir)
filename = os.path.basename(remote_path)
cmd = "sdb -s %s pull %s %s" % (
self.deviceid, remote_path, local_path_dir)
exit_code, ret = shell_command(cmd)
if exit_code != 0:
error = ret[0].strip('\r\n') if len(ret) else "sdb shell timeout"
LOGGER.info("[ Download file \"%s\" failed, error: %s ]"
% (remote_path, error))
return False
else:
src_path = os.path.join(local_path_dir, filename)
if src_path != local_path:
shutil.move(src_path, local_path)
return True