feat: household TV companion with scoped pairing and direct LAN camera strip

This commit is contained in:
Codex
2026-10-16 00:35:17 +08:00
parent fb87ae4de9
commit 6aa20391b2
42 changed files with 1153 additions and 33 deletions
+4 -2
View File
@@ -110,9 +110,11 @@ class WebTests(unittest.TestCase):
self.assertEqual(headers['Cache-Control'], 'no-store')
self.assertNotIn(b'__ASSET_VERSION__', body)
assets = re.findall(r'(?:src|href)="(/ui/assets/[^"?]+\.(?:js|css))"', body.decode())
self.assertEqual(len(assets), 2)
self.assertGreaterEqual(len(assets), 2)
self.assertTrue(any('/index-' in asset and asset.endswith('.js') for asset in assets))
self.assertTrue(any('/index-' in asset and asset.endswith('.css') for asset in assets))
for asset in assets:
self.assertRegex(asset,r'/ui/assets/index-[A-Za-z0-9_-]+\.(js|css)$')
self.assertRegex(asset,r'/ui/assets/[A-Za-z0-9_.-]+-[A-Za-z0-9_-]+\.(js|css)$')
self.assertEqual(self.request(asset, False)[0], 200)
for path in ['/ui/assets/../../vision.db','/ui/assets/missing.js','/ui/index.html']:
self.assertEqual(self.request(path,False)[0],404)