File: test_codecs.py

package info (click to toggle)
python-aiortc 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,040 kB
  • sloc: python: 19,999; javascript: 286; makefile: 18; sh: 1
file content (18 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from unittest import TestCase

from aiortc.codecs import get_decoder, get_encoder
from aiortc.rtcrtpparameters import RTCRtpCodecParameters

BOGUS_CODEC = RTCRtpCodecParameters(
    mimeType="audio/bogus", clockRate=8000, channels=1, payloadType=0
)


class CodecsTest(TestCase):
    def test_get_decoder(self):
        with self.assertRaises(ValueError):
            get_decoder(BOGUS_CODEC)

    def test_get_encoder(self):
        with self.assertRaises(ValueError):
            get_encoder(BOGUS_CODEC)