|
|
import os |
|
|
import pytest |
|
|
from app import evaluate_trl |
|
|
from dotenv import load_dotenv |
|
|
|
|
|
load_dotenv() |
|
|
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") |
|
|
|
|
|
|
|
|
@pytest.mark.skipif(not GEMINI_API_KEY, reason="No GEMINI_API_KEY set, skipping integration test") |
|
|
def test_evaluate_trl_integration(): |
|
|
proposal_text = """ |
|
|
This proposal describes a laboratory prototype of a new sensor technology |
|
|
with proof of concept demonstrated through simulation and lab testing. |
|
|
""" |
|
|
|
|
|
trl, reasoning = evaluate_trl(proposal_text) |
|
|
|
|
|
assert trl is not None, "TRL should not be None" |
|
|
assert isinstance(trl, int), "TRL should be an integer" |
|
|
assert 1 <= trl <= 9, "TRL should be between 1 and 9" |
|
|
|
|
|
assert reasoning is not None and len(reasoning) > 0, "Reasoning should not be empty" |
|
|
|
|
|
print(f"Integration Test Result - TRL: {trl}") |
|
|
print(f"Reasoning: {reasoning}") |
|
|
|