Esempio n. 1
0
    def test_list_test_info_works_with_dne_test_suite(self):
        # Determine data file path
        data_file = get_data_file(filename=self.SAMPLE_PATH,
                                  test_dir_name=self.TEST_DIR_NAME,
                                  data_dir_name=self.DATA_DIR_NAME)

        # Execute routine
        state_path_obj = StatePathsYaml(data_file)
        state_path_obj.list_test_info(test_suite='imaginary')
Esempio n. 2
0
    # Set up the logging
    logfile = args.args.logfile
    logging_level = logger.Logger.STR_TO_VAL['debug' if debug else 'info']
    logging = logger.Logger(default_level=logging_level, filename=logfile)
    logging.debug(f"Logging Project: {logging.project}")
    if logfile is not None:
        logfile = os.path.abspath(logfile)

    # Get the selected test case info
    tests = StatePathsYaml(input_file=test_file_name)

    # If requested, display the test suites and test cases based on the
    # CLI input
    if args.args.list:
        print(tests.list_test_info(test_suite=test_suite_name))
        exit()

    # ERROR: no test suite or test case specified
    elif (args.args.test_suite_name is None
          or args.args.test_case_name is None):
        logging.error("Need to specify test_suite_name AND test_case_name.")
        exit(1)

    # List the input files for reference
    display_input_files(log=logging,
                        model_file=machine_cfg_file,
                        test_file=test_file_name,
                        ts_name=test_suite_name,
                        tc_name=test_case_name,
                        log_file=logfile)