diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-13 16:39:50 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-13 16:39:50 +0100 |
| commit | 6b03740a8c9fb98b788549412f0ebf3cbae1d2de (patch) | |
| tree | 85f9532f1efdc63ecebb9c42a3e7a3c0b764e5d3 /tests/test_server.py | |
| parent | 4bc6d69fc0fbfc3de5fb84874985a26deb79fdb5 (diff) | |
| download | deck-it-6b03740a8c9fb98b788549412f0ebf3cbae1d2de.tar.gz deck-it-6b03740a8c9fb98b788549412f0ebf3cbae1d2de.zip | |
feat(tablet): clock fonts and sizes from keystone's Fonts page
The dim cover's time and date fonts move out of [tablet] clock_font and
clock_font_date into keystone's fonts.json: "family" deckit-clock and
deckit-date, each served at /fonts/<key>, and the "override" sizes
deckit:clock and deckit:date (else deck.css's 8rem and 1.6rem). The date
can now have a font of its own. theme.css carries the rules, so a save
on the Fonts page reaches an open tablet page within 5s, with no restart
and no flags in the tablet state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_server.py')
| -rw-r--r-- | tests/test_server.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_server.py b/tests/test_server.py index 8f82e9f..4d734b4 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -143,14 +143,14 @@ class Server(unittest.TestCase): from pathlib import Path f = Path(tempfile.mkdtemp()) / "Graffiti.ttf" f.write_bytes(b"\x00\x01\x00\x00clock") - with mock.patch.dict(srv.CFG, {"tablet": {"clock_font": "a Graffiti"}}): + with mock.patch.object(srv.theme, "families", return_value={"deckit-date": "a Graffiti"}): with mock.patch.object(srv, "_run", return_value=f"a Graffiti\n{f}"): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0:2], (200, b"\x00\x01\x00\x00clock")) + self.assertEqual(self.req("GET", "/fonts/deckit-date?f=a%20Graffiti", HOST)[0:2], + (200, b"\x00\x01\x00\x00clock")) + self.assertEqual(self.req("GET", "/fonts/deckit-clock", HOST)[0], 404) # unset # fc-match's fallback for a font that is not installed with mock.patch.object(srv, "_run", return_value="DejaVu Sans\n/usr/share/fonts/DejaVuSans.ttf"): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0], 404) - with mock.patch.dict(srv.CFG, {"tablet": {}}): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0], 404) + self.assertEqual(self.req("GET", "/fonts/deckit-date", HOST)[0], 404) def test_assets_and_api(self): self.assertEqual(self.req("GET", "/", HOST)[0], 200) |
