aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_server.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 16:25:12 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 16:25:12 +0100
commitec140125f208d5f6e507dfe6b8e9abc7236cb21b (patch)
treea6ba7593121981b11f0f8167b1059a572731d15e /tests/test_server.py
parentea5a277c6b8bb2ba48b0ca8822797cf6ab0b3405 (diff)
downloaddeck-it-ec140125f208d5f6e507dfe6b8e9abc7236cb21b.tar.gz
deck-it-ec140125f208d5f6e507dfe6b8e9abc7236cb21b.zip
feat(assistant): a faint picture behind the Assistant tab
`[assistant] background` names an image (none by default); the server serves it at /api/bg behind the token, and the tab shows its subject from the right side, desaturated and faded out on every side so no edge shows: opacity .24 while the chat is empty, .07 during a conversation. Tuned on the 1280x800 tablet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_server.py')
-rw-r--r--tests/test_server.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_server.py b/tests/test_server.py
index d37723e..054b3a6 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -102,6 +102,18 @@ class Server(unittest.TestCase):
conn.close()
self.assertEqual(r.getheader("X-Deckit-Sleep"), "1")
+ def test_background_follows_the_config(self):
+ from unittest import mock
+ import tempfile
+ from pathlib import Path
+ f = Path(tempfile.mkdtemp()) / "bg.jpg"
+ f.write_bytes(b"\xff\xd8jpeg")
+ with mock.patch.dict(srv.CFG, {"assistant": {"background": str(f)}}):
+ self.assertEqual(self.req("GET", "/api/bg", HOST), (200, b"\xff\xd8jpeg"))
+ self.assertEqual(self.req("GET", "/api/bg", {"Host": "127.0.0.1:8765"})[0], 401)
+ with mock.patch.dict(srv.CFG, {"assistant": {"background": ""}}):
+ self.assertEqual(self.req("GET", "/api/bg", HOST)[0], 404)
+
def test_nerd_font(self):
from unittest import mock
import tempfile