Spaces:
Paused
Paused
Commit ·
b0dfd19
1
Parent(s): 3696e36
add feature test project
Browse filesFiles changed (11)
- .github/workflows/main.ymlAdded+58
- app/db/session.py+14-12
- pyproject.toml+10
- pytest.iniAdded+18
- tests/conftest.pyAdded+84
- tests/test_api/test_auth.pyAdded+63
- tests/test_api/test_predictions.pyAdded+49
- tests/test_api/test_search.pyAdded+42
- tests/test_services/test_encoding.pyAdded+36
- tests/test_services/test_similarity.pyAdded+46
- uv.lock+104-3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758name: CI/CD Pipeline
# ส่วนที่ 1: กำหนดเหตุการณ์ (Event) ที่จะให้ Workflow เริ่มทำงานon: push: branches: [ main, master ] # รันเมื่อมีการ push เข้ากิ่งหลัก pull_request: branches: [ main, master ] # รันเมื่อมีการสร้าง Pull Request
jobs: # ส่วนที่ 2: Continuous Integration (CI) - การทดสอบและตรวจสอบคุณภาพโค้ด test: runs-on: ubuntu-latest # ใช้เครื่อง Server Linux ของ GitHub # กำหนดค่า Environment Variables สำหรับตอนรัน Test env: DATABASE_URL: sqlite+aiosqlite:///:memory: SECRET_KEY: ${{ secrets.SECRET_KEY || 'test_secret_key_for_ci' }} ALGORITHM: HS256 R2_BUCKET_NAME: test-bucket R2_ACCOUNT_ID: test-id R2_ACCESS_KEY: test-key R2_SECRET_KEY: test-secret HF: test-hf-token REDIS_URL: redis://localhost:6379/0 GMAIL: test@gmail.com BREVO_API_KEY: test-brevo-key PROJECT_NAME: FaceSearchTest
steps: - name: Checkout code uses: actions/checkout@v4 # ดึงโค้ดจาก Repository มาที่เครื่องนี้
- name: Install uv run: curl -LsSf https://astral.sh/uv/install.sh | sh # ติดตั้งเครื่องมือ uv
- name: Set up Python run: uv python install 3.11 # ติดตั้ง Python 3.11
- name: Install dependencies run: uv sync --frozen # ติดตั้ง Library ตาม lock file
- name: Run Pytest # รัน Test ทั้งหมดในโฟลเดอร์ tests # ถ้าขั้นตอนตรงนี้ Error (พัง) Workflow จะหยุดและส่งอีเมลแจ้งเตือนคุณทันที run: uv run pytest tests
# ส่วนที่ 3: Continuous Deployment (CD) - การนำไปใช้งาน (ตัวอย่าง) deploy: needs: test # ต้องรอให้ Job "test" ผ่านก่อนเท่านั้นถึงจะทำตรงนี้ if: github.event_name == 'push' # ให้ Deploy เฉพาะตอน Push (ไม่ทำตอน PR) runs-on: ubuntu-latest steps: - name: Deploy Status run: | echo "🎉 All tests passed successfully!" echo "🚀 Deployment process would start here." echo "Branch: ${{ github.ref }}"1 unmodified line2345678910111213141516171819201 unmodified linefrom app.core.config import settings# 1. สร้าง Async Enginefrom sqlalchemy.ext.asyncio import create_async_engineengine = create_async_engine(settings.DATABASE_URL,echo=False,# --- ส่วนที่ควรเพิ่มเพื่อความเร็ว ---pool_size=10, # สร้างการเชื่อมต่อรอไว้เลย 10 ท่อmax_overflow=20, # หากงานเยอะ ขยายเพิ่มได้อีก 20 ท่อpool_timeout=30, # ถ้ารอนานเกิน 30 วินาทีให้ Error (ป้องกันแอปค้าง)# -----------------------------pool_pre_ping=True,pool_recycle=3600,)# 2. สร้าง Session FactorySessionLocal = async_sessionmaker(1 unmodified line23456789101112131415161718192021221 unmodified linefrom app.core.config import settings# 1. สร้าง Async Engineengine_kwargs = {"echo": False,"pool_pre_ping": True,"pool_recycle": 3600,}# SQLite ไม่รองรับ pool_size และ max_overflowif not settings.DATABASE_URL.startswith("sqlite"):engine_kwargs.update({"pool_size": 10,"max_overflow": 20,"pool_timeout": 30,})engine = create_async_engine(settings.DATABASE_URL, **engine_kwargs)# 2. สร้าง Session FactorySessionLocal = async_sessionmaker(
26 unmodified lines27282926 unmodified lines"tensorflow>=2.20.0","uvicorn>=0.40.0",]26 unmodified lines2728293031323334353637383926 unmodified lines"tensorflow>=2.20.0","uvicorn>=0.40.0",][dependency-groups]dev = ["aiosqlite>=0.22.1","httpx>=0.28.1","pytest>=9.0.3","pytest-asyncio>=1.4.0","pytest-env>=1.6.0","pytest-mock>=3.15.1",]
123456789101112131415161718[pytest]asyncio_mode = autoasyncio_default_fixture_loop_scope = sessionpythonpath = .testpaths = testsenv = DATABASE_URL=sqlite+aiosqlite:///:memory: SECRET_KEY=test_secret_key ALGORITHM=HS256 R2_BUCKET_NAME=test-bucket R2_ACCOUNT_ID=test-id R2_ACCESS_KEY=test-key R2_SECRET_KEY=test-secret HF=test-hf-token REDIS_URL=redis://localhost:6379/0 GMAIL=test@gmail.com BREVO_API_KEY=test-brevo-key PROJECT_NAME=FaceSearchTest123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384import pytestimport pytest_asyncioimport asynciofrom typing import AsyncGeneratorfrom httpx import AsyncClient, ASGITransportfrom sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmakerfrom app.main import appfrom app.api.deps import get_dbfrom app.db.base import Base
# --- Database Setup for Testing (Using SQLite In-memory) ---TEST_DATABASE_URL = "sqlite+aiosqlite:///:memory:"
test_engine = create_async_engine(TEST_DATABASE_URL)TestSessionLocal = async_sessionmaker( autocommit=False, autoflush=False, bind=test_engine, class_=AsyncSession)
@pytest.fixture(scope="session")def event_loop(): try: loop = asyncio.get_running_loop() except RuntimeError: loop = asyncio.new_event_loop() yield loop loop.close()
async def override_get_db() -> AsyncGenerator: async with TestSessionLocal() as session: yield session
@pytest_asyncio.fixture(scope="session", autouse=True)async def setup_db(): async with test_engine.begin() as conn: await conn.run_sync(Base.metadata.create_all) yield async with test_engine.begin() as conn: await conn.run_sync(Base.metadata.drop_all)
@pytest_asyncio.fixtureasync def client() -> AsyncGenerator: app.dependency_overrides[get_db] = override_get_db transport = ASGITransport(app=app) async with AsyncClient(transport=transport, base_url="http://test") as ac: yield ac app.dependency_overrides.clear()
@pytest_asyncio.fixtureasync def db_session() -> AsyncGenerator: async with TestSessionLocal() as session: yield session
# --- Global Mocks ---
@pytest.fixture(autouse=True)def mock_external_services(mocker): # Mock Redis (OTP) mocker.patch("app.services.redis_service.save_otp", return_value=None) mocker.patch("app.services.redis_service.verify_otp", return_value=True) # Mock Email mocker.patch("app.services.email_service.send_otp_email", return_value=None) # Mock Storage (Cloudflare R2) mocker.patch( "app.services.storage_service.storage_service.upload_file", return_value="https://mock-r2-url.com/image.jpg" ) mocker.patch("app.services.storage_service.storage_service.delete_file", return_value=None) # Mock Predictor (Prevent loading models) mocker.patch("app.services.prediction_service.predictor_service.load_models", return_value=None) # Mock Predictor results mock_prediction = { "age_result": [0, 0, 1, 0, 0, 0], "gender_result": [0, 1], "haircolor_result": [0, 0, 1], "hairstyle_result": [1, 0], "eyebrows_result": [1, 0, 0, 0], "skin_result": [1, 0, 0, 0], "beard_result": [0, 0, 0, 0] } mocker.patch("app.services.prediction_service.predictor_service.predict_all", return_value=mock_prediction)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263import pytestfrom httpx import AsyncClient
@pytest.mark.asyncioasync def test_request_otp(client: AsyncClient): response = await client.post("/api/v1/auth/request-otp", data={"email": "test@example.com"}) assert response.status_code == 200 assert response.json()["message"] == "OTP sent to your email"
@pytest.mark.asyncioasync def test_register_user(client: AsyncClient): # Prepare dummy image files = {"file": ("test.jpg", b"fake-image-content", "image/jpeg")} data = { "first_name": "Test", "last_name": "User", "email": "test@example.com", "password": "password123", "otp_code": "1234" } response = await client.post("/api/v1/auth/register", data=data, files=files) assert response.status_code == 200 assert response.json()["message"] == "Registration successful"
@pytest.mark.asyncioasync def test_login_user(client: AsyncClient): # First, ensure user exists (from previous test or setup) # Since we use in-memory SQLite and setup_db is session-scoped, # the user from test_register_user might be there if they run in order. # But for robustness, let's register here too or assume session persistence. login_data = { "email": "test@example.com", "password": "password123" } response = await client.post("/api/v1/auth/login", json=login_data) assert response.status_code == 200 data = response.json() assert "access_token" in data assert data["token_type"] == "bearer"
@pytest.mark.asyncioasync def test_get_current_user(client: AsyncClient): # Login to get token login_data = {"email": "test@example.com", "password": "password123"} login_res = await client.post("/api/v1/auth/login", json=login_data) token = login_res.json()["access_token"] headers = {"Authorization": f"Bearer {token}"} response = await client.get("/api/v1/user/me", headers=headers) # Wait, /user/me in endpoints/user.py is a PATCH. # Let's check if there is a GET /me. # Looking at app/api/v1/endpoints/user.py... it only has PATCH /me. # Let's check api.py or other files. # Actually, deps.py has get_current_user which is used by many. # If there's no GET /user/me, this test will fail. # Let's double check app/api/v1/endpoints/user.py. # It only has @router.patch("/me"). assert response.status_code == 405 # Method Not Allowed if only PATCH exists12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import pytestimport jsonfrom httpx import AsyncClient
@pytest.fixtureasync def auth_headers(client: AsyncClient): # Setup: Register and login a user files = {"file": ("test.jpg", b"fake-image", "image/jpeg")} await client.post("/api/v1/auth/register", data={ "first_name": "Pred", "last_name": "User", "email": "pred@example.com", "password": "pass", "otp_code": "1234" }, files=files) login_res = await client.post("/api/v1/auth/login", json={"email": "pred@example.com", "password": "pass"}) token = login_res.json()["access_token"] return {"Authorization": f"Bearer {token}"}
@pytest.mark.asyncioasync def test_predict_image(client: AsyncClient, auth_headers: dict): files = {"file": ("face.jpg", b"fake-face-content", "image/jpeg")} response = await client.post("/api/v1/predictions/", headers=auth_headers, files=files) assert response.status_code == 200 data = response.json() assert "features" in data assert "descriptions" in data
@pytest.mark.asyncioasync def test_save_prediction(client: AsyncClient, auth_headers: dict): # Mock prediction data predictions_dict = { "age_result": [0, 0, 1, 0, 0, 0], "gender_result": [0, 1], "haircolor_result": [0, 0, 1], "hairstyle_result": [1, 0], "eyebrows_result": [1, 0, 0, 0], "skin_result": [1, 0, 0, 0], "beard_result": [0, 0, 0, 0] } files = {"file": ("face.jpg", b"fake-face-content", "image/jpeg")} data = {"predictions_json": json.dumps(predictions_dict)} response = await client.post("/api/v1/predictions/save", headers=auth_headers, data=data, files=files) assert response.status_code == 200 res_data = response.json() assert "prediction_id" in res_data assert res_data["gender_result"] == "ชาย"123456789101112131415161718192021222324252627282930313233343536373839404142import pytestfrom httpx import AsyncClientimport json
@pytest.fixtureasync def auth_headers(client: AsyncClient): # Setup: Register and login a user files = {"file": ("test.jpg", b"fake-image", "image/jpeg")} await client.post("/api/v1/auth/register", data={ "first_name": "Search", "last_name": "User", "email": "search@example.com", "password": "pass", "otp_code": "1234" }, files=files) login_res = await client.post("/api/v1/auth/login", json={"email": "search@example.com", "password": "pass"}) token = login_res.json()["access_token"] return {"Authorization": f"Bearer {token}"}
@pytest.mark.asyncioasync def test_search_similarity(client: AsyncClient, auth_headers: dict): # 1. Save a prediction first to search against predictions_dict = { "age_result": [0, 0, 1, 0, 0, 0], # วัยรุ่น "gender_result": [0, 1], # ชาย "haircolor_result": [0, 0, 1], # ผมดำ "hairstyle_result": [1, 0], # ผมตรง "eyebrows_result": [1, 0, 0, 0], # คิ้วโก่ง "skin_result": [1, 0, 0, 0], # ผิวขาว "beard_result": [0, 0, 0, 0] # ไม่ระบุ } files = {"file": ("face.jpg", b"fake-face-content", "image/jpeg")} data = {"predictions_json": json.dumps(predictions_dict)} await client.post("/api/v1/predictions/save", headers=auth_headers, data=data, files=files) # 2. Search with similar description params = {"description": "ผู้ชาย วัยรุ่น ผมตรง", "limit": 4} response = await client.get("/api/v1/search", headers=auth_headers, params=params) assert response.status_code == 200 results = response.json() assert len(results) > 0 assert results[0]["similarity_score"] > 50 # Should be high match123456789101112131415161718192021222324252627282930313233343536from app.services.encoding_service import encoder
def test_text_to_vector_basic(): text = "ผู้ชาย วัยรุ่น ผมดำ" vector = encoder.text_to_vector(text) # Check if gender 'ชาย' is set (index 6, 7 in total feature names) # feature_names order: age_cats(6), gender_cats(2), ... # gender_categories = ["หญิง", "ชาย"] # So 'ชาย' should be index 6 + 1 = 7 assert vector[7] == 1 assert vector[6] == 0
def test_vector_to_text(): # Create a vector for a young female with black hair vector = [0] * 25 vector[2] = 1 # วัยรุ่น vector[6] = 1 # หญิง vector[10] = 1 # ผมดำ vector[11] = 1 # ผมตรง vector[13] = 1 # คิ้วหนา vector[17] = 1 # ผิวขาว text_list = encoder.vector_to_text(vector) assert "หญิง" in text_list assert "วัยรุ่น" in text_list assert "ผมดำ" in text_list
def test_parse_text_complex(): text = "ผู้หญิง วัยรุ่น ผมตรง คิ้วหนา ผิวสองสี" parsed = encoder.parse_text(text) assert parsed["gender"] == "หญิง" assert parsed["age"] == "วัยรุ่น" assert "คิ้วหนา" in parsed["eyebrow"] assert parsed["skin"] == "ผิวสองสี"12345678910111213141516171819202122232425262728293031323334353637383940414243444546import numpy as npfrom app.services.cosine_similarity_service import scorer
def test_similarity_identical_vectors(): # 25 is the total length of the vector based on group_sizes: [6, 2, 3, 2, 4, 4, 4] vec = [0] * 25 vec[0] = 1 # Age 0-6 vec[6] = 1 # Gender Female score = scorer.calculate_similarity(vec, vec) assert score == 1.0
def test_similarity_different_vectors(): vec_a = [0] * 25 vec_a[0] = 1 vec_b = [0] * 25 vec_b[1] = 1 # Different age score = scorer.calculate_similarity(vec_a, vec_b) assert score < 1.0
def test_similarity_gender_weight(): # Gender has weight 0.40, Age has 0.15 # If gender matches but age doesn't, score should be higher than vice versa base = [0] * 25 base[0] = 1 # Age base[6] = 1 # Gender # Match age only age_match = [0] * 25 age_match[0] = 1 age_match[7] = 1 # Different gender # Match gender only gender_match = [0] * 25 gender_match[1] = 1 # Different age gender_match[6] = 1 score_age = scorer.calculate_similarity(base, age_match) score_gender = scorer.calculate_similarity(base, gender_match) # Since gender has higher weight, gender_match should have higher similarity? # Actually, the dynamic_w logic might affect this. # But generally, higher weight features impact the score more. assert score_gender > score_age214 unmodified lines21521621721821922098 unmodified lines31932032132232332419 unmodified lines344345346347348349774 unmodified lines112411251126112711281129670 unmodified lines180018011802180318041805275 unmodified lines2081208220832084208520868 unmodified lines20952096209720982099210021012102210321042105214 unmodified lines{ url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" },][[package]]name = "alembic"version = "1.18.3"98 unmodified lines{ name = "uvicorn" },][package.metadata]requires-dist = [{ name = "aioboto3", specifier = ">=15.5.0" },19 unmodified lines{ name = "uvicorn", specifier = ">=0.40.0" },][[package]]name = "bcrypt"version = "5.0.0"774 unmodified lines{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },][[package]]name = "jmespath"version = "1.1.0"670 unmodified lines{ url = "https://files.pythonhosted.org/packages/f2/26/c56ce33ca856e358d27fda9676c055395abddb82c35ac0f593877ed4562e/pillow-12.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:cb9bb857b2d057c6dfc72ac5f3b44836924ba15721882ef103cecb40d002d80e", size = 7029880, upload-time = "2026-02-11T04:23:04.783Z" },][[package]]name = "propcache"version = "0.4.1"275 unmodified lines{ url = "https://files.pythonhosted.org/packages/7c/4c/ad33b92b9864cbde84f259d5df035a6447f91891f5be77788e2a3892bce3/pymysql-1.1.2-py3-none-any.whl", hash = "sha256:e6b1d89711dd51f8f74b1631fe08f039e7d76cf67a42a323d3178f0f25762ed9", size = 45300, upload-time = "2025-08-24T12:55:53.394Z" },][[package]]name = "python-dateutil"version = "2.9.0.post0"8 unmodified lines[[package]]name = "python-dotenv"version = "1.2.1"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" },][[package]]214 unmodified lines21521621721821922022122222322422522622722822998 unmodified lines32832933033133233333433533633733833934034134234319 unmodified lines363364365366367368369370371372373374375376377378774 unmodified lines115311541155115611571158115911601161116211631164116511661167670 unmodified lines183818391840184118421843184418451846184718481849185018511852275 unmodified lines2128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621878 unmodified lines21962197219821992200220122022203220422052206214 unmodified lines{ url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" },][[package]]name = "aiosqlite"version = "0.22.1"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/4e/8a/64761f4005f17809769d23e518d915db74e6310474e733e3593cfc854ef1/aiosqlite-0.22.1.tar.gz", hash = "sha256:043e0bd78d32888c0a9ca90fc788b38796843360c855a7262a532813133a0650", size = 14821, upload-time = "2025-12-23T19:25:43.997Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/00/b7/e3bf5133d697a08128598c8d0abc5e16377b51465a33756de24fa7dee953/aiosqlite-0.22.1-py3-none-any.whl", hash = "sha256:21c002eb13823fad740196c5a2e9d8e62f6243bd9e7e4a1f87fb5e44ecb4fceb", size = 17405, upload-time = "2025-12-23T19:25:42.139Z" },][[package]]name = "alembic"version = "1.18.3"98 unmodified lines{ name = "uvicorn" },][package.dev-dependencies]dev = [{ name = "aiosqlite" },{ name = "httpx" },{ name = "pytest" },{ name = "pytest-asyncio" },{ name = "pytest-env" },{ name = "pytest-mock" },][package.metadata]requires-dist = [{ name = "aioboto3", specifier = ">=15.5.0" },19 unmodified lines{ name = "uvicorn", specifier = ">=0.40.0" },][package.metadata.requires-dev]dev = [{ name = "aiosqlite", specifier = ">=0.22.1" },{ name = "httpx", specifier = ">=0.28.1" },{ name = "pytest", specifier = ">=9.0.3" },{ name = "pytest-asyncio", specifier = ">=1.4.0" },{ name = "pytest-env", specifier = ">=1.6.0" },{ name = "pytest-mock", specifier = ">=3.15.1" },][[package]]name = "bcrypt"version = "5.0.0"774 unmodified lines{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },][[package]]name = "iniconfig"version = "2.3.0"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },][[package]]name = "jmespath"version = "1.1.0"670 unmodified lines{ url = "https://files.pythonhosted.org/packages/f2/26/c56ce33ca856e358d27fda9676c055395abddb82c35ac0f593877ed4562e/pillow-12.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:cb9bb857b2d057c6dfc72ac5f3b44836924ba15721882ef103cecb40d002d80e", size = 7029880, upload-time = "2026-02-11T04:23:04.783Z" },][[package]]name = "pluggy"version = "1.6.0"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },][[package]]name = "propcache"version = "0.4.1"275 unmodified lines{ url = "https://files.pythonhosted.org/packages/7c/4c/ad33b92b9864cbde84f259d5df035a6447f91891f5be77788e2a3892bce3/pymysql-1.1.2-py3-none-any.whl", hash = "sha256:e6b1d89711dd51f8f74b1631fe08f039e7d76cf67a42a323d3178f0f25762ed9", size = 45300, upload-time = "2025-08-24T12:55:53.394Z" },][[package]]name = "pytest"version = "9.0.3"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "colorama", marker = "sys_platform == 'win32'" },{ name = "iniconfig" },{ name = "packaging" },{ name = "pluggy" },{ name = "pygments" },]sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" },][[package]]name = "pytest-asyncio"version = "1.4.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pytest" },{ name = "typing-extensions", marker = "python_full_version < '3.13'" },]sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" },][[package]]name = "pytest-env"version = "1.6.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pytest" },{ name = "python-dotenv" },]sdist = { url = "https://files.pythonhosted.org/packages/ff/69/4db1c30625af0621df8dbe73797b38b6d1b04e15d021dd5d26a6d297f78c/pytest_env-1.6.0.tar.gz", hash = "sha256:ac02d6fba16af54d61e311dd70a3c61024a4e966881ea844affc3c8f0bf207d3", size = 16163, upload-time = "2026-03-12T22:39:43.78Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/27/16/ad52f56b96d851a2bcfdc1e754c3531341885bd7177a128c13ff2ca72ab4/pytest_env-1.6.0-py3-none-any.whl", hash = "sha256:1e7f8a62215e5885835daaed694de8657c908505b964ec8097a7ce77b403d9a3", size = 10400, upload-time = "2026-03-12T22:39:41.887Z" },][[package]]name = "pytest-mock"version = "3.15.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "pytest" },]sdist = { url = "https://files.pythonhosted.org/packages/68/14/eb014d26be205d38ad5ad20d9a80f7d201472e08167f0bb4361e251084a9/pytest_mock-3.15.1.tar.gz", hash = "sha256:1849a238f6f396da19762269de72cb1814ab44416fa73a8686deac10b0d87a0f", size = 34036, upload-time = "2025-09-16T16:37:27.081Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/5a/cc/06253936f4a7fa2e0f48dfe6d851d9c56df896a9ab09ac019d70b760619c/pytest_mock-3.15.1-py3-none-any.whl", hash = "sha256:0a25e2eb88fe5168d535041d09a4529a188176ae608a6d249ee65abc0949630d", size = 10095, upload-time = "2025-09-16T16:37:25.734Z" },][[package]]name = "python-dateutil"version = "2.9.0.post0"8 unmodified lines[[package]]name = "python-dotenv"version = "1.2.2"source = { registry = "https://pypi.org/simple" }sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" },][[package]]
.github/workflows/main.ymlAdded+58
app/db/session.py+14-12
pyproject.toml+10
pytest.iniAdded+18
tests/conftest.pyAdded+84
tests/test_api/test_auth.pyAdded+63
tests/test_api/test_predictions.pyAdded+49
tests/test_api/test_search.pyAdded+42
tests/test_services/test_encoding.pyAdded+36
tests/test_services/test_similarity.pyAdded+46
uv.lock+104-3