# 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

    with pytest.raises(SchemaParseException):
        fastavro.parse_schema(enum_schema)

    # Should parse with name
    for schema in (record_schema, error_schema, fixed_schema, enum_schema):
        schema["name"] = "test_named_types_have_names"
        fastavro.parse_schema(schema)


def test_parse_schema():
    schema = {
        "type": "record",
        "name": "test_parse_schema",
        "fields": [{"name": "field", "type": "string"}],
    }

    parsed_schema = parse_schema(schema)
    assert "__fastavro_parsed" in parsed_schema

    parsed_schema_again = parse_schema(parsed_schema)
    assert parsed_schema_again == parsed_schema


def test_unknown_type():
    with pytest.raises(UnknownType):
        parse_schema({"type": "unknown"})


def test_aliases_are_preserved():

# 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


    with pytest.raises(SchemaParseException):
        fastavro.parse_schema(enum_schema)

    # Should parse with name
    for schema in (record_schema, error_schema, fixed_schema, enum_schema):
        schema["name"] = "test_named_types_have_names"
        fastavro.parse_schema(schema)


def test_parse_schema():
    schema = {
        "type": "record",
        "name": "test_parse_schema",
        "fields": [{"name": "field", "type": "string"}],
    }

    parsed_schema = parse_schema(schema)
    assert "__fastavro_parsed" in parsed_schema

    parsed_schema_again = parse_schema(parsed_schema)
    assert parsed_schema_again == parsed_schema


def test_unknown_type():
    with pytest.raises(UnknownType):
        parse_schema({"type": "unknown"})


def test_aliases_are_preserved():

    schema = {