Add cloud sprite providers and browser demos

This commit is contained in:
Emil
2026-07-29 13:54:36 +03:00
parent 703fef0f87
commit 0e8b5d1fbc
16 changed files with 1113 additions and 9 deletions
+25 -1
View File
@@ -10,7 +10,7 @@ import tempfile
import pytest
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from feedback import FeedbackDB, FeedbackEntry, DBStats, _tokenize
from feedback import FeedbackDB, FeedbackEntry, DBStats, StyleReference, _tokenize
@pytest.fixture
@@ -283,6 +283,30 @@ class TestDelete:
assert entries[0].prompt == "archer"
class TestStyleReferences:
def test_add_and_list_style_reference(self, db):
reference_id = db.add_style_reference(
"/tmp/style.png", "Asterion vanguard", "fleet style", "cyan engines", 10
)
references = db.get_style_references()
assert references[0].id == reference_id
assert isinstance(references[0], StyleReference)
assert references[0].name == "Asterion vanguard"
def test_style_reference_upserts_by_image_path(self, db):
first = db.add_style_reference("/tmp/style.png", "old", "style")
second = db.add_style_reference("/tmp/style.png", "new", "style", priority=5)
assert first == second
references = db.get_style_references()
assert len(references) == 1
assert references[0].name == "new"
def test_delete_style_reference(self, db):
reference_id = db.add_style_reference("/tmp/style.png", "ship", "style")
db.delete_style_reference(reference_id)
assert db.get_style_references() == []
class TestExportJsonl:
def test_export_jsonl(self, db, tmp_path):
_add_sample(db, "knight", rating=5, feedback="great")