当前位置: 首页>>代码示例>>Python>>正文


Python BuiltIn.strip方法代码示例

本文整理汇总了Python中robot.libraries.BuiltIn.BuiltIn.strip方法的典型用法代码示例。如果您正苦于以下问题:Python BuiltIn.strip方法的具体用法?Python BuiltIn.strip怎么用?Python BuiltIn.strip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在robot.libraries.BuiltIn.BuiltIn的用法示例。


在下文中一共展示了BuiltIn.strip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_log_directory

# 需要导入模块: from robot.libraries.BuiltIn import BuiltIn [as 别名]
# 或者: from robot.libraries.BuiltIn.BuiltIn import strip [as 别名]
def test_log_directory():
    """This function will create case log directory for saving TA log when you call it firstly.
       If you want to save or use TA log, you must call this keyword on your TA case.
    """
    global TEST_CASE_NAME
    global TEST_LOG_PATH
    try:
        test_case_name = BuiltIn().get_variables()['${TEST_NAME}']
    except:
        try:
            test_case_name = BuiltIn().get_variables()['${SUITE_NAME}']
        except:
            test_case_name = "mt_case_name"
    test_case_name = test_case_name.strip().replace(" ", "_")
    if TEST_CASE_NAME != test_case_name:
        try:
            output_dir = BuiltIn().get_variables()['${OUTPUT_DIR}']
        except:
            output_dir = "mt_output_dir"
        test_suite_path = os.path.join(output_dir, "log")
        TEST_CASE_NAME = test_case_name
        test_name_with_timestamp = test_case_name + "_" + time.strftime("%Y%m%d%H%M%S", time.localtime()) + "/"
        test_log_directory = os.path.join(test_suite_path, test_name_with_timestamp)
        TEST_LOG_PATH = test_log_directory
    if not os.path.exists(TEST_LOG_PATH):
        os.makedirs(TEST_LOG_PATH)
    return TEST_LOG_PATH
开发者ID:feiyuw,项目名称:rfts,代码行数:29,代码来源:test_lib.py


注:本文中的robot.libraries.BuiltIn.BuiltIn.strip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。