Commit 77d5ac2e

Robert Craigie <robert@craigie.dev>
2025-07-07 20:37:02
chore(tests): ensure vector store files create and poll method is in sync
1 parent 32a3296
Changed files (1)
tests
api_resources
vector_stores
tests/api_resources/vector_stores/test_files.py
@@ -9,6 +9,7 @@ import pytest
 
 from openai import OpenAI, AsyncOpenAI
 from tests.utils import assert_matches_type
+from openai._utils import assert_signatures_in_sync
 from openai.pagination import SyncPage, AsyncPage, SyncCursorPage, AsyncCursorPage
 from openai.types.vector_stores import (
     VectorStoreFile,
@@ -625,3 +626,14 @@ class TestAsyncFiles:
                 file_id="",
                 vector_store_id="vs_abc123",
             )
+
+
+@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
+def test_create_and_poll_method_in_sync(sync: bool, client: OpenAI, async_client: AsyncOpenAI) -> None:
+    checking_client: OpenAI | AsyncOpenAI = client if sync else async_client
+
+    assert_signatures_in_sync(
+        checking_client.vector_stores.files.create,
+        checking_client.vector_stores.files.create_and_poll,
+        exclude_params={"extra_headers", "extra_query", "extra_body", "timeout"},
+    )