generated from kgod/ai-review-template
30 lines
807 B
Python
30 lines
807 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from sqlalchemy import create_engine, text
|
|
|
|
|
|
def test_langgraph_runtime_is_available() -> None:
|
|
from langgraph.graph import START, StateGraph
|
|
|
|
graph = StateGraph(dict)
|
|
graph.add_node("finish", lambda state: state)
|
|
graph.add_edge(START, "finish")
|
|
|
|
assert graph.compile().invoke({}) == {}
|
|
|
|
|
|
def test_postgres_test_database_has_pgvector() -> None:
|
|
database_url = os.environ["RESUME_AGENT_TEST_DATABASE_URL"]
|
|
engine = create_engine(database_url)
|
|
try:
|
|
with engine.connect() as connection:
|
|
extension = connection.execute(
|
|
text("SELECT extname FROM pg_extension WHERE extname = 'vector'")
|
|
).scalar_one_or_none()
|
|
finally:
|
|
engine.dispose()
|
|
|
|
assert extension == "vector"
|