Skip to content

Commit bb37c85

Browse files
feat(tests): add fixtures and test for document processing
- Introduced new pytest fixtures `path_fixtures_docs` and `path_fixtures_dummy_doc` to provide paths for the docs directory and a dummy document, respectively. - Added a test case `test_get_with_docs_with_default_model` to verify the response from the `VisionAgent` when querying with a dummy document. - Included a dummy document `dummy.docx` for testing purposes.
1 parent f006857 commit bb37c85

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ def path_fixtures_dummy_excel(path_fixtures_excel: pathlib.Path) -> pathlib.Path
5252
return path_fixtures_excel / "dummy.xlsx"
5353

5454

55+
@pytest.fixture
56+
def path_fixtures_docs(path_fixtures: pathlib.Path) -> pathlib.Path:
57+
"""Fixture providing the path to the docs directory."""
58+
return path_fixtures / "docs"
59+
60+
61+
@pytest.fixture
62+
def path_fixtures_dummy_doc(path_fixtures_docs: pathlib.Path) -> pathlib.Path:
63+
"""Fixture providing the path to the dummy doc."""
64+
return path_fixtures_docs / "dummy.docx"
65+
66+
5567
@pytest.fixture
5668
def github_login_screenshot(path_fixtures_screenshots: pathlib.Path) -> Image.Image:
5769
"""Fixture providing the GitHub login screenshot."""

tests/e2e/agent/test_get.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ def test_get_with_xlsx_with_default_model_with_chart_data(
166166
assert "10000" in response.lower()
167167

168168

169+
def test_get_with_docs_with_default_model(
170+
vision_agent: VisionAgent, path_fixtures_dummy_doc: pathlib.Path
171+
) -> None:
172+
response = vision_agent.get(
173+
"At what time in 24h format does the person sleeps?",
174+
source=path_fixtures_dummy_doc,
175+
)
176+
assert isinstance(response, str)
177+
assert "22:00" in response.lower()
178+
179+
169180
def test_get_with_model_composition_should_use_default_model(
170181
agent_toolbox_mock: AgentToolbox,
171182
askui_facade: ModelFacade,

tests/fixtures/docs/dummy.docx

6.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)