HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/pkgs/nbformat-5.10.4-py312haa95532_0/info/test/tests/base.py
"""
Contains base test class for nbformat
"""

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations

import os
import unittest


class TestsBase(unittest.TestCase):
    """Base tests class."""

    @classmethod
    def fopen(cls, f, mode="r", encoding="utf-8"):
        return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding)  # noqa

    @classmethod
    def _get_files_path(cls):
        return os.path.dirname(__file__)