Input validation work and error handling

This commit is contained in:
Bradley committed 2026-11-13 22:18:45 -05:00
1 parent 4e2520ee76
commit 554b7cc82c
20 files changed
+627 -96

No files matched your search

+4 -2
View File
@@ -107,8 +107,10 @@ class MediaLibraryTest(unittest.TestCase):
BEGIN SELECT RAISE(ABORT, 'Test failure'); END
''')
db.commit()
with self.assertRaises(sqlite3.IntegrityError):
self.client.post(f'/media/{second}/play')
with self.assertLogs(self.app.logger, level='ERROR'):
response = self.client.post(f'/media/{second}/play')
self.assertEqual(response.status_code, 503)
self.assertIn(b'database is unavailable', response.data)
self.assert_active(first)
def test_status_matches_player_priority_and_changes(self):