graphrag/tests/unit/load_config/config.py
Derek Worthen e0cce31f54
Some checks failed
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.12) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.12) (push) Has been cancelled
Graphrag config (#2119)
* Add load_config to graphrag-common package.
2025-11-10 07:57:03 -08:00

28 lines
827 B
Python

# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Config models for load_config unit tests."""
from pydantic import BaseModel, ConfigDict, Field
class TestNestedModel(BaseModel):
"""Test nested model."""
model_config = ConfigDict(extra="forbid")
nested_str: str = Field(description="A nested field.")
nested_int: int = Field(description="Another nested field.")
class TestConfigModel(BaseModel):
"""Test configuration model."""
model_config = ConfigDict(extra="forbid")
__test__ = False # type: ignore
name: str = Field(description="Name field.")
value: int = Field(description="Value field.")
nested: TestNestedModel = Field(description="Nested model field.")
nested_list: list[TestNestedModel] = Field(description="List of nested models.")