class_docstr: Stores integration test cases generated by parsing YAML files.
docstr: Parse the YAML file at the given path into test cases.
docstr_tok: ["Parse","the","YAML","file","at","the","given","path","into","test","cases","."]
code: def _parse_config_yaml(
      file_path: str,
  ) -> Sequence[ConfiguredIntegrationTestCase]:
      """Parse the YAML file at the given path into test cases."""
      results = []
  
      with open(file_path) as f:
          file_contents = f.read()
          for config_document in yaml.load_all(
              stream=file_contents, Loader=yaml.SafeLoader
          ):
              # The config document can be None if there is nothing but white space between two `---`
              # this isn't really an issue, so lets just swallow it
              if config_document is None:
                  continue
              if not isinstance(config_document, dict):
                  raise TestCaseParseException(
                      f"Test query object YAML must be a dict. Got `{type(config_document)}`: {config_document}"
                  )
  
              keys = tuple(x for x in config_document.keys())
              if len(keys) != 1:
                  raise TestCaseParseException(
                      f"Test case document should have one type of key, but this has {len(keys)}. "
                      f"Found keys: {keys} in {file_path}",
                  )
  
              # retrieve last top-level key as type
              document_type = next(iter(config_document.keys()))
              object_cfg = config_document[document_type]
              if document_type == DOCUMENT_KEY:
                  try:
                      results.append(
                          ConfiguredIntegrationTestCase(
                              **object_cfg, file_path=file_path
                          )
                      )
                  except Exception as e:
                      raise TestCaseParseException(
                          f"Error while parsing: {file_path}"
                      ) from e
              else:
                  raise TestCaseParseException(
                      f"Expected {DOCUMENT_KEY}, but got {document_type}"
                  )
      return results
  
imports: from __future__ import annotations
  import logging
  import os
  from collections import OrderedDict
  from enum import Enum
  from typing import Dict, Optional, Sequence, Tuple
  import yaml
  from dbt_semantic_interfaces.implementations.base import FrozenBaseModel
label_desc: Use image node_id 2 for calling the ConfiguredIntegrationTestCaseRepository obj's underlying member method code with example usage: obj._parse_config_yaml(file_path) and returns: results