# 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
    schema2 = [
        {
            "name": "Weather",
            "type": "record",
            "fields": [{"name": "of", "type": "Location"}],
        },
        {
            "name": "Location",
            "type": "record",
            "fields": [{"name": "city", "type": "long"}],
        },
    ]
    # This should not work because Location is defined after it is used
    with pytest.raises(UnknownType):
        parse_schema(schema2)


def test_using_named_schemas_to_handle_references():
    location = {
        "name": "Location",
        "type": "record",
        "fields": [{"name": "city", "type": "long"}],
    }
    weather = {
        "name": "Weather",
        "type": "record",
        "fields": [{"name": "of", "type": "Location"}],
    }

    named_schemas = {}

# 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

    schema2 = [
        {
            "name": "Weather",
            "type": "record",
            "fields": [{"name": "of", "type": "Location"}],
        },
        {
            "name": "Location",
            "type": "record",
            "fields": [{"name": "city", "type": "long"}],
        },
    ]
    # This should not work because Location is defined after it is used
    with pytest.raises(UnknownType):
        parse_schema(schema2)


def test_using_named_schemas_to_handle_references():
    location = {
        "name": "Location",
        "type": "record",
        "fields": [{"name": "city", "type": "long"}],
    }
    weather = {
        "name": "Weather",
        "type": "record",
        "fields": [{"name": "of", "type": "Location"}],
    }

    named_schemas = {}

    parse_schema(location, named_schemas)