|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
"""Test for Serializable base class"""
|
|
|
|
|
|
|
|
|
|
from typing import Any, Dict
|
|
|
|
|
from typing import Any, Dict, List
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
from langchain_community.chat_models.openai import ChatOpenAI
|
|
|
|
@ -37,6 +37,10 @@ class SpecialPerson(Person):
|
|
|
|
|
|
|
|
|
|
another_visible: str = "bye"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def get_lc_namespace(cls) -> List[str]:
|
|
|
|
|
return ["my", "special", "namespace"]
|
|
|
|
|
|
|
|
|
|
# Gets merged with parent class's secrets
|
|
|
|
|
@property
|
|
|
|
|
def lc_secrets(self) -> Dict[str, str]:
|
|
|
|
@ -58,6 +62,7 @@ def test_person(snapshot: Any) -> None:
|
|
|
|
|
sp = SpecialPerson(another_secret="Wooo", secret="Hmm")
|
|
|
|
|
assert dumps(sp, pretty=True) == snapshot
|
|
|
|
|
assert Person.lc_id() == ["tests", "unit_tests", "load", "test_dump", "Person"]
|
|
|
|
|
assert SpecialPerson.lc_id() == ["my", "special", "namespace", "SpecialPerson"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_typeerror() -> None:
|
|
|
|
|