INNER CODE UNIT · Python
_run_test
usnistgov/OSCAL · src/specifications/profile-resolution/spec-tester.py:350
def _run_test(self, driver: Driver, requirement: TestRequirement, indent=0) -> bool:
test_pass = True
for scenario in requirement["scenarios"]:
scenario_info = f"{INDENT_TEXT * indent}scenario(source='{scenario['source_profile_path']}', expected='{scenario['expected_catalog_path']}')"
self.logger.info(f"{Colors.BOLD}{scenario_info}{Colors.END}")
scenario_pass = self._run_test_scenario(
driver, scenario, indent=indent + 1)
if scenario_pass:
self.logger.info(
f"{Colors.BOLD}{Colors.GREEN}{scenario_info}... PASS{Colors.END}")
else:
# TODO: param to fail if the level is not "must"
self.logger.error(
f"{Colors.BOLD}{Colors.RED}{scenario_info}... FAIL{Colors.END}")