Implemented modular code structure

Refactored repository into kaya-core and kaya-rsgi packages
This commit is contained in:
2026-07-15 22:18:45 +08:00
parent eca6da3dc3
commit fa3ff32f66
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))