def __init__(self, conf_path): self._config = ConfigParser() self._config_path = conf_path try: self._config.read(self._config_path)[0] except IndexError: logger.warning("Tests configuration '%s' can not be read!", conf_path) else: logger.debug("Using Tests configuration from '%s'.", conf_path)
def __init__(self, cli_conf): self._config = ConfigParser() self._add_commandline_arguments(cli_conf) if cli_conf.cli_config_path: config_abs_path = os.path.abspath(cli_conf.cli_config_path) try: self._config.read(config_abs_path)[0] except IndexError: logger.warning("Configuration file '%s' could not be read... " "Using ONLY default settings", config_abs_path) else: logger.debug("Using configuration from '%s'", config_abs_path)
def __init__(self, cli_conf): self._config = ConfigParser() self._add_commandline_arguments(cli_conf) if cli_conf.cli_config_path: config_abs_path = os.path.abspath(cli_conf.cli_config_path) try: self._config.read(config_abs_path)[0] except IndexError: logger.warning( "Configuration file '%s' could not be read... " "Using ONLY default settings", config_abs_path) else: logger.debug("Using configuration from '%s'", config_abs_path)
def _add_project_specific_environment_py(self): """ Adds project specific environment.py from execution_dir/test/ into the working directory. It is renamed and included in the common environment.py :return: """ project_environment_py = os.path.join(self._project_tests_dir, 'environment.py') if os.path.exists(project_environment_py): logger.info("Using project specific environment.py from '%s'", project_environment_py.replace( self._execution_dir + os.sep, '')) shutil.copy(project_environment_py, self._working_dir) else: logger.warning("Not using project specific environment.py. '%s' does not exist!", project_environment_py)
def _add_project_specific_features(self): """ Adds project specific features from execution_dir/test/features into the features in working directory :return: """ project_features_dir = os.path.join(self._project_tests_dir, 'features') if os.path.exists(project_features_dir): logger.info("Using project specific Features from '%s'", project_features_dir.replace(self._execution_dir + os.sep, '')) shutil.copytree(project_features_dir, self._features_dir) else: logger.warning("Not using project specific Features. '%s' does not exist!", project_features_dir)
def _add_project_specific_steps(self): """ Adds project specific steps from execution_dir/test/steps into the steps in working directory. :return: """ project_steps_dir = os.path.join(self._project_tests_dir, 'steps') if os.path.exists(project_steps_dir): logger.info("Using project specific Steps from '%s'", project_steps_dir.replace(self._execution_dir + os.sep, '')) shutil.copytree(project_steps_dir, os.path.join(self._steps_dir, '{0}_steps'.format(os.path.basename( self._execution_dir).replace('-', '_')))) else: logger.warning("Not using project specific Steps. '%s' does not exist!", project_steps_dir)