INNER CODE UNIT · Python

RequirementTests

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

class RequirementTests(object):
    def __init__(self, spec_path=DEFAULT_SPEC_PATH, tests_path=DEFAULT_TESTS_PATH,
                 logger: Optional[logging.Logger] = None) -> None:
        self.spec_path = spec_path
        self.tests_path = tests_path

        self.spec = ET.parse(self.spec_path)

        self.logger = logger if logger is not None else logging.getLogger(
            __name__)

        with open(self.tests_path) as tests_file:
            tests_json = json.loads(tests_file.read())
            # TODO any sort of input validation, this is currently at best a type hint
            self.tests: List[TestRequirement] = tests_json

        # used to resolve files relative to the spec file
        self.tests_workdir = os.path.dirname(self.tests_path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…