本文整理汇总了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__)
示例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()