File: test_base.py

package info (click to toggle)
python-websockets 15.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,948 kB
  • sloc: python: 25,105; javascript: 350; ansic: 148; makefile: 43
file content (30 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest

from websockets.extensions.base import *
from websockets.frames import Frame, Opcode


class ExtensionTests(unittest.TestCase):
    def test_encode(self):
        with self.assertRaises(NotImplementedError):
            Extension().encode(Frame(Opcode.TEXT, b""))

    def test_decode(self):
        with self.assertRaises(NotImplementedError):
            Extension().decode(Frame(Opcode.TEXT, b""))


class ClientExtensionFactoryTests(unittest.TestCase):
    def test_get_request_params(self):
        with self.assertRaises(NotImplementedError):
            ClientExtensionFactory().get_request_params()

    def test_process_response_params(self):
        with self.assertRaises(NotImplementedError):
            ClientExtensionFactory().process_response_params([], [])


class ServerExtensionFactoryTests(unittest.TestCase):
    def test_process_request_params(self):
        with self.assertRaises(NotImplementedError):
            ServerExtensionFactory().process_request_params([], [])