# Path: fastavro/repository/base.py
# class AbstractSchemaRepository(ABC):
#     @abstractmethod
#     def load(self, name):
#         pass
# 
# Path: fastavro/schema.py
# FINGERPRINT_ALGORITHMS = _schema.FINGERPRINT_ALGORITHMS


from os.path import join, abspath, dirname
from fastavro.repository import AbstractSchemaRepository
from fastavro.schema import (
    SchemaParseException,
    UnknownType,
    parse_schema,
    fullname,
    expand_schema,
)
import pytest
import fastavro
    load_schema_dir = join(abspath(dirname(__file__)), "load_schema_test_14")
    schema_path = join(load_schema_dir, "A.avsc")
    loaded_schema = fastavro.schema.load_schema(schema_path, _write_hint=False)

    expected_schema = "string"
    assert loaded_schema == expected_schema


def test_load_schema_union_names():
    """https://github.com/fastavro/fastavro/issues/527"""
    load_schema_dir = join(abspath(dirname(__file__)), "load_schema_test_15")
    schema_path = join(load_schema_dir, "A.avsc")
    loaded_schema = fastavro.schema.load_schema(schema_path, _write_hint=False)

    expected_schema = [
        {
            "name": "B",
            "type": "record",
            "fields": [{"name": "foo", "type": "string"}],
        },
        {
            "name": "C",
            "type": "record",
            "fields": [{"name": "bar", "type": "string"}],
        },
    ]
    assert loaded_schema == expected_schema


def test_load_schema_accepts_custom_repository():

# Path: fastavro/repository/base.py
# class AbstractSchemaRepository(ABC):
#     @abstractmethod
#     def load(self, name):
#         pass
# 
# Path: fastavro/schema.py
# FINGERPRINT_ALGORITHMS = _schema.FINGERPRINT_ALGORITHMS


# Path: tests/test_schema.py
from os.path import join, abspath, dirname
from fastavro.repository import AbstractSchemaRepository
from fastavro.schema import (
    SchemaParseException,
    UnknownType,
    parse_schema,
    fullname,
    expand_schema,
)
import pytest
import fastavro

    load_schema_dir = join(abspath(dirname(__file__)), "load_schema_test_14")
    schema_path = join(load_schema_dir, "A.avsc")
    loaded_schema = fastavro.schema.load_schema(schema_path, _write_hint=False)

    expected_schema = "string"
    assert loaded_schema == expected_schema


def test_load_schema_union_names():
    """https://github.com/fastavro/fastavro/issues/527"""
    load_schema_dir = join(abspath(dirname(__file__)), "load_schema_test_15")
    schema_path = join(load_schema_dir, "A.avsc")
    loaded_schema = fastavro.schema.load_schema(schema_path, _write_hint=False)

    expected_schema = [
        {
            "name": "B",
            "type": "record",
            "fields": [{"name": "foo", "type": "string"}],
        },
        {
            "name": "C",
            "type": "record",
            "fields": [{"name": "bar", "type": "string"}],
        },
    ]
    assert loaded_schema == expected_schema


def test_load_schema_accepts_custom_repository():

    class LocalSchemaRepository(AbstractSchemaRepository):