Skip to content

Commit

Permalink
fix: unpacking of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AJDERS committed Apr 24, 2024
1 parent 7e3d3e2 commit 150e10c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions tests/test_rag_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from omegaconf import DictConfig
from ragger.rag_system import RagSystem
from ragger.utils import Document, GeneratedAnswer
from ragger.utils import GeneratedAnswer


class TestRagSystem:
Expand Down Expand Up @@ -78,16 +78,14 @@ def test_compile(self, valid_rag_system):

def test_answer(self, valid_rag_system):
"""Test that the RagSystem can answer a query."""
answer, documents = valid_rag_system.answer(
"Hvad hedder den hvide og sorte kat?"
)
assert answer
assert documents
assert isinstance(answer, str)
assert isinstance(documents, list)
for document in documents:
assert isinstance(document, Document)
assert len(documents) == 2
answer = valid_rag_system.answer("Hvad hedder den hvide og sorte kat?")
assert answer.answer
assert answer.sources
assert isinstance(answer.answer, str)
assert isinstance(answer.sources, list)
for index in answer.sources:
assert isinstance(index, str)
assert len(answer.sources) == 2
expected_answer = GeneratedAnswer(
answer="Den sorte og hvide kat hedder Sutsko.", sources=["2"]
)
Expand Down

0 comments on commit 150e10c

Please sign in to comment.