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


Python DriverWrappersPool.get_configured_value方法代码示例

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


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

示例1: configure_logger

# 需要导入模块: from toolium.driver_wrappers_pool import DriverWrappersPool [as 别名]
# 或者: from toolium.driver_wrappers_pool.DriverWrappersPool import get_configured_value [as 别名]
    def configure_logger(self, tc_config_log_filename=None, tc_output_log_filename=None):
        """Configure selenium instance logger

        :param tc_config_log_filename: test case specific logging config file
        :param tc_output_log_filename: test case specific output logger file
        """
        # Get config logger filename
        config_log_filename = DriverWrappersPool.get_configured_value('Config_log_filename', tc_config_log_filename,
                                                                      'logging.conf')
        config_log_filename = os.path.join(DriverWrappersPool.config_directory, config_log_filename)

        # Configure logger only if logging filename has changed
        if self.config_log_filename != config_log_filename:
            # Get output logger filename
            output_log_filename = DriverWrappersPool.get_configured_value('Output_log_filename', tc_output_log_filename,
                                                                          'toolium.log')
            output_log_filename = os.path.join(DriverWrappersPool.output_directory, output_log_filename)
            output_log_filename = output_log_filename.replace('\\', '\\\\')

            try:
                logging.config.fileConfig(config_log_filename, {'logfilename': output_log_filename}, False)
            except Exception as exc:
                print("[WARN] Error reading logging config file '{}': {}".format(config_log_filename, exc))
            self.config_log_filename = config_log_filename
            self.output_log_filename = output_log_filename
            self.logger = logging.getLogger(__name__)
开发者ID:jframos,项目名称:toolium,代码行数:28,代码来源:driver_wrapper.py

示例2: configure_properties

# 需要导入模块: from toolium.driver_wrappers_pool import DriverWrappersPool [as 别名]
# 或者: from toolium.driver_wrappers_pool.DriverWrappersPool import get_configured_value [as 别名]
    def configure_properties(self, tc_config_prop_filenames=None):
        """Configure selenium instance properties

        :param tc_config_prop_filenames: test case specific properties filenames
        """
        prop_filenames = DriverWrappersPool.get_configured_value('Config_prop_filenames', tc_config_prop_filenames,
                                                                 'properties.cfg;local-properties.cfg')
        prop_filenames = [os.path.join(DriverWrappersPool.config_directory, filename) for filename in
                          prop_filenames.split(';')]
        prop_filenames = ';'.join(prop_filenames)

        # Configure config only if properties filename has changed
        if self.config_properties_filenames != prop_filenames:
            # Initialize the config object
            self.config = ExtendedConfigParser.get_config_from_file(prop_filenames)
            self.config_properties_filenames = prop_filenames

        # Override properties with system properties
        self.config.update_from_system_properties()
开发者ID:cesarca,项目名称:toolium,代码行数:21,代码来源:driver_wrapper.py


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