INNER CODE UNIT · Python

_run_test_scenario

usnistgov/OSCAL · src/specifications/profile-resolution/spec-tester.py:372

    def _run_test_scenario(self, driver: Driver, scenario: TestScenario, indent=0) -> bool:
        """
        Runs a given test scenario, returning True if all selection expressions pass
        """

        self.logger.info(
            f"{Colors.BLUE}{INDENT_TEXT * indent}Description: {scenario['description']}{Colors.END}")

        # Correct for path relative to spec tests file
        expected_path = scenario["expected_catalog_path"]
        if not os.path.isabs(expected_path):
            expected_path = os.path.join(self.tests_workdir, expected_path)
        # TODO user friendly error if catalog path cannot be found
        expected = ET.parse(expected_path)

        # Driver already uses the spec tests file's parent dir as the cwd, no path correction needed
        result = driver.run(scenario["source_profile_path"], indent=indent + 1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…