def load_golden(
        self,
        golden_path: Union[str, Path],
    ) -> Union[serial_utils.JSON, pd.DataFrame]:
        """Load the golden file `path` and return its contents.

        Args:
            golden_path: The name of the golden file to load. The file must
                have an extension of either `.json` or `.yaml`. The extension
                determines the input format.
        """
        golden_path = Path(golden_path)

        if ".json" in golden_path.suffixes:
            loader = functools.partial(json.load)
        elif ".yaml" in golden_path.suffixes or ".yml" in golden_path.suffixes:
            loader = functools.partial(yaml.load, Loader=yaml.FullLoader)
        elif ".csv" in golden_path.suffixes:
            loader = functools.partial(pd.read_csv, index_col=0)
        else:
            raise ValueError(f"Unknown file extension {golden_path}.")

        if not golden_path.exists():
            raise FileNotFoundError(f"Golden file {golden_path} not found.")

        with golden_path.open() as f:
            return loader(f)
Load the golden file `path` and return its contents.

        Args:
            golden_path: The name of the golden file to load. The file must
                have an extension of either `.json` or `.yaml`. The extension
                determines the input format.
        
tests/test.py