Migrate to package

This commit is contained in:
2026-03-02 17:44:18 +00:00
parent 3e2386b9b6
commit 8dfd2048a5
13 changed files with 356 additions and 31 deletions

36
tests/conftest.py Normal file
View File

@@ -0,0 +1,36 @@
"""Pytest configuration and shared fixtures."""
import os
from unittest.mock import MagicMock
import pytest
@pytest.fixture(autouse=True)
def mock_env_vars(monkeypatch):
"""Set required environment variables for testing."""
test_env = {
"PROJECT_ID": "test-project",
"LOCATION": "us-central1",
"BUCKET": "test-bucket",
"INDEX_NAME": "test-index",
"DEPLOYED_INDEX_ID": "test-deployed-index",
"ENDPOINT_NAME": "projects/test/locations/us-central1/indexEndpoints/test",
"ENDPOINT_DOMAIN": "test.us-central1-aiplatform.googleapis.com",
}
for key, value in test_env.items():
monkeypatch.setenv(key, value)
@pytest.fixture
def mock_gcs_storage():
"""Mock Google Cloud Storage client."""
mock = MagicMock()
return mock
@pytest.fixture
def mock_vector_search():
"""Mock vector search client."""
mock = MagicMock()
return mock