Fix test_database.py method names to match Database API

- upsert_page → store_page (2 occurrences)
- get_media → get_media_by_hash (2 occurrences)
- search_media → search_media_advanced
This commit is contained in:
Russell Ballestrini 2026-01-05 14:57:49 -05:00
parent c351753290
commit 00bad59920

View file

@ -266,7 +266,7 @@ class TestMediaOperations:
)
# Verify media was created
media = await db.get_media("d41d8cd98f00b204e9800998ecf8427e")
media = await db.get_media_by_hash("d41d8cd98f00b204e9800998ecf8427e")
assert media is not None
assert media['media_type'] == 'image'
@ -299,7 +299,7 @@ class TestMediaOperations:
)
# Should still have only one media record
media = await db.get_media("d41d8cd98f00b204e9800998ecf8427e")
media = await db.get_media_by_hash("d41d8cd98f00b204e9800998ecf8427e")
assert media is not None
# But should have two sources
@ -329,7 +329,7 @@ class TestPageOperations:
job_id = await db.create_crawl_job(target_uri="https://example.com")
await db.upsert_page(
await db.store_page(
uri="https://example.com/about",
title="About Page",
content="This is the about page content.",
@ -351,7 +351,7 @@ class TestPageOperations:
job_id = await db.create_crawl_job(target_uri="https://example.com")
await db.upsert_page(
await db.store_page(
uri="https://example.com/test",
title="Test",
content="Test content",
@ -395,7 +395,7 @@ class TestSearchOperations:
searchable_text="sunset ocean beautiful landscape",
)
results = await db.search_media("sunset", limit=10)
results = await db.search_media_advanced(q="sunset", limit=10)
# Result depends on search implementation
assert isinstance(results, list)