File: test_codecs.py

package info (click to toggle)
python-aiortc 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,052 kB
  • sloc: python: 20,294; javascript: 321; makefile: 21; 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)