File: test_rtcsessiondescription.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 (19 lines) | stat: -rw-r--r-- 622 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from unittest import TestCase

from aiortc import RTCSessionDescription


class RTCSessionDescriptionTest(TestCase):
    def test_bad_type(self):
        with self.assertRaises(ValueError) as cm:
            RTCSessionDescription(sdp="v=0\r\n", type="bogus")
        self.assertEqual(
            str(cm.exception),
            "'type' must be in ['offer', 'pranswer', 'answer', 'rollback'] "
            "(got 'bogus')",
        )

    def test_good_type(self):
        desc = RTCSessionDescription(sdp="v=0\r\n", type="answer")
        self.assertEqual(desc.sdp, "v=0\r\n")
        self.assertEqual(desc.type, "answer")