mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-22 12:37:53 +00:00
fix: remove @pytest.mark.asyncio from test_get_raw_document_text.py (#2840)
# What does this PR do? <!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. --> The pre-commit workflow was failing in the main branch and removing `@pytest.mark.asyncio `from `test_get_raw_document_text.py` fixed that. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* -->
This commit is contained in:
parent
89c49eb003
commit
9e6860b9cf
1 changed files with 0 additions and 11 deletions
|
@ -14,7 +14,6 @@ from llama_stack.apis.common.content_types import URL, TextContentItem
|
||||||
from llama_stack.providers.inline.agents.meta_reference.agent_instance import get_raw_document_text
|
from llama_stack.providers.inline.agents.meta_reference.agent_instance import get_raw_document_text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_supports_text_mime_types():
|
async def test_get_raw_document_text_supports_text_mime_types():
|
||||||
"""Test that the function accepts text/* mime types."""
|
"""Test that the function accepts text/* mime types."""
|
||||||
document = Document(content="Sample text content", mime_type="text/plain")
|
document = Document(content="Sample text content", mime_type="text/plain")
|
||||||
|
@ -23,7 +22,6 @@ async def test_get_raw_document_text_supports_text_mime_types():
|
||||||
assert result == "Sample text content"
|
assert result == "Sample text content"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_supports_yaml_mime_type():
|
async def test_get_raw_document_text_supports_yaml_mime_type():
|
||||||
"""Test that the function accepts application/yaml mime type."""
|
"""Test that the function accepts application/yaml mime type."""
|
||||||
yaml_content = """
|
yaml_content = """
|
||||||
|
@ -40,7 +38,6 @@ async def test_get_raw_document_text_supports_yaml_mime_type():
|
||||||
assert result == yaml_content
|
assert result == yaml_content
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_supports_deprecated_text_yaml_with_warning():
|
async def test_get_raw_document_text_supports_deprecated_text_yaml_with_warning():
|
||||||
"""Test that the function accepts text/yaml but emits a deprecation warning."""
|
"""Test that the function accepts text/yaml but emits a deprecation warning."""
|
||||||
yaml_content = """
|
yaml_content = """
|
||||||
|
@ -68,7 +65,6 @@ async def test_get_raw_document_text_supports_deprecated_text_yaml_with_warning(
|
||||||
assert "deprecated" in str(w[0].message).lower()
|
assert "deprecated" in str(w[0].message).lower()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_deprecated_text_yaml_with_url():
|
async def test_get_raw_document_text_deprecated_text_yaml_with_url():
|
||||||
"""Test that text/yaml works with URL content and emits warning."""
|
"""Test that text/yaml works with URL content and emits warning."""
|
||||||
yaml_content = "name: test\nversion: 1.0"
|
yaml_content = "name: test\nversion: 1.0"
|
||||||
|
@ -92,7 +88,6 @@ async def test_get_raw_document_text_deprecated_text_yaml_with_url():
|
||||||
assert "text/yaml" in str(w[0].message)
|
assert "text/yaml" in str(w[0].message)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_deprecated_text_yaml_with_text_content_item():
|
async def test_get_raw_document_text_deprecated_text_yaml_with_text_content_item():
|
||||||
"""Test that text/yaml works with TextContentItem and emits warning."""
|
"""Test that text/yaml works with TextContentItem and emits warning."""
|
||||||
yaml_content = "key: value\nlist:\n - item1\n - item2"
|
yaml_content = "key: value\nlist:\n - item1\n - item2"
|
||||||
|
@ -112,7 +107,6 @@ async def test_get_raw_document_text_deprecated_text_yaml_with_text_content_item
|
||||||
assert "text/yaml" in str(w[0].message)
|
assert "text/yaml" in str(w[0].message)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_rejects_unsupported_mime_types():
|
async def test_get_raw_document_text_rejects_unsupported_mime_types():
|
||||||
"""Test that the function rejects unsupported mime types."""
|
"""Test that the function rejects unsupported mime types."""
|
||||||
document = Document(
|
document = Document(
|
||||||
|
@ -124,7 +118,6 @@ async def test_get_raw_document_text_rejects_unsupported_mime_types():
|
||||||
await get_raw_document_text(document)
|
await get_raw_document_text(document)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_with_url_content():
|
async def test_get_raw_document_text_with_url_content():
|
||||||
"""Test that the function handles URL content correctly."""
|
"""Test that the function handles URL content correctly."""
|
||||||
mock_response = AsyncMock()
|
mock_response = AsyncMock()
|
||||||
|
@ -140,7 +133,6 @@ async def test_get_raw_document_text_with_url_content():
|
||||||
mock_load.assert_called_once_with("https://example.com/test.txt")
|
mock_load.assert_called_once_with("https://example.com/test.txt")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_with_yaml_url():
|
async def test_get_raw_document_text_with_yaml_url():
|
||||||
"""Test that the function handles YAML URLs correctly."""
|
"""Test that the function handles YAML URLs correctly."""
|
||||||
yaml_content = "name: test\nversion: 1.0"
|
yaml_content = "name: test\nversion: 1.0"
|
||||||
|
@ -155,7 +147,6 @@ async def test_get_raw_document_text_with_yaml_url():
|
||||||
mock_load.assert_called_once_with("https://example.com/config.yaml")
|
mock_load.assert_called_once_with("https://example.com/config.yaml")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_with_text_content_item():
|
async def test_get_raw_document_text_with_text_content_item():
|
||||||
"""Test that the function handles TextContentItem correctly."""
|
"""Test that the function handles TextContentItem correctly."""
|
||||||
document = Document(content=TextContentItem(text="Text content item"), mime_type="text/plain")
|
document = Document(content=TextContentItem(text="Text content item"), mime_type="text/plain")
|
||||||
|
@ -164,7 +155,6 @@ async def test_get_raw_document_text_with_text_content_item():
|
||||||
assert result == "Text content item"
|
assert result == "Text content item"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_with_yaml_text_content_item():
|
async def test_get_raw_document_text_with_yaml_text_content_item():
|
||||||
"""Test that the function handles YAML TextContentItem correctly."""
|
"""Test that the function handles YAML TextContentItem correctly."""
|
||||||
yaml_content = "key: value\nlist:\n - item1\n - item2"
|
yaml_content = "key: value\nlist:\n - item1\n - item2"
|
||||||
|
@ -175,7 +165,6 @@ async def test_get_raw_document_text_with_yaml_text_content_item():
|
||||||
assert result == yaml_content
|
assert result == yaml_content
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_get_raw_document_text_rejects_unexpected_content_type():
|
async def test_get_raw_document_text_rejects_unexpected_content_type():
|
||||||
"""Test that the function rejects unexpected document content types."""
|
"""Test that the function rejects unexpected document content types."""
|
||||||
# Create a mock document that bypasses Pydantic validation
|
# Create a mock document that bypasses Pydantic validation
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue