Refactored repository into kaya-core and kaya-rsgi packages

This commit is contained in:
2026-07-15 13:39:58 +00:00
parent eca6da3dc3
commit 7c766caf47
33 changed files with 238 additions and 387 deletions
+22
View File
@@ -0,0 +1,22 @@
import unittest
from kaya.rsgi import RsgiWebSocket
class RsgiWebSocketTest(unittest.TestCase):
def test_misconfigured_granian(self):
class FakeScope:
scheme = 'ws'
path = '/ws'
query_string = ''
headers = {}
client = '127.0.0.1:12345'
server = '127.0.0.1:80'
class FakeProtocol:
pass
with self.assertRaises(RuntimeError) as ctx:
RsgiWebSocket(FakeScope(), FakeProtocol()) # type: ignore[arg-type]
self.assertIn('Granian was not configured for websockets', str(ctx.exception))