- def tests_in_suite(suite_name, tests):
- """Check if the suite includes tests.
-
- :param suite_name: Name of the suite to be checked.
- :param tests: Set of tests
- :type suite_name: str
- :type tests: pandas.Series
- :returns: True if the suite includes tests.
- :rtype: bool
- """
-
- for key in tests.keys():
- if suite_name == tests[key]["parent"]:
- return True
- return False
-
- file_name = "{0}{1}".format(file_spec["output-file"],
- file_spec["output-file-ext"])
- rst_header = file_spec["file-header"]
- rst_include_table = ("\n.. csv-table::\n"
- " :header-rows: 1\n"
- " :widths: auto\n"
- " :align: center\n"
- " :file: {file}\n\n")
-
- logging.info(" Generating the file {0} ...".format(file_name))
-
- table_lst = get_files(file_spec["dir-tables"], ".csv", full_path=False)
- if len(table_lst) == 0:
- logging.error(" No tables to include in '{0}'. Skipping.".
- format(file_spec["dir-tables"]))
- return None
-
- job = file_spec["data"].keys()[0]
- build = str(file_spec["data"][job][0])
-
- logging.info(" Writing file '{0}'".format(file_name))
-
- suites = input_data.suites(job, build)[file_spec["data-start-level"]:]
+ file_name = f"{file_spec[u'output-file']}{file_spec[u'output-file-ext']}"
+ rst_header = file_spec[u"file-header"]
+
+ logging.info(f" Generating the file {file_name} ...")
+
+ table_lst = get_files(file_spec[u"dir-tables"], u".csv", full_path=True)
+ if not table_lst:
+ logging.error(
+ f" No tables to include in {file_spec[u'dir-tables']}. Skipping."
+ )
+ return
+
+ logging.info(f" Writing file {file_name}")
+
+ logging.info(
+ f" Creating the tests data set for the "
+ f"{file_spec.get(u'type', u'')} {file_spec.get(u'title', u'')}."
+ )
+ tests = input_data.filter_data(file_spec)
+ tests = input_data.merge_data(tests)
+
+ logging.info(
+ f" Creating the suites data set for the "
+ f"{file_spec.get(u'type', u'')} {file_spec.get(u'title', u'')}."
+ )
+ file_spec[u"filter"] = u"all"
+ suites = input_data.filter_data(file_spec, data_set=u"suites")
+ suites = input_data.merge_data(suites)