为所有函数和类添加中文注释文档字符串
This commit is contained in:
@@ -2,9 +2,11 @@ from __future__ import annotations
|
||||
|
||||
from app.signaling.ice_parser import parse_ice
|
||||
|
||||
|
||||
class TestIceParser:
|
||||
"""ICE候选者解析单元测试"""
|
||||
|
||||
def test_parse_valid_ice(self):
|
||||
"""测试:解析有效的ICE host候选者"""
|
||||
data = {
|
||||
"candidate": "1234567890 1 UDP 2130706431 192.168.1.1 12345 typ host",
|
||||
"sdpMid": "0",
|
||||
@@ -20,9 +22,11 @@ class TestIceParser:
|
||||
assert cand.type == "host"
|
||||
|
||||
def test_parse_invalid_ice(self):
|
||||
"""测试:解析无效ICE字符串应返回None"""
|
||||
assert parse_ice({"candidate": "invalid"}) is None
|
||||
|
||||
def test_parse_srflx(self):
|
||||
"""测试:解析含有raddr/rport的srflx候选者"""
|
||||
data = {
|
||||
"candidate": "abcdef 1 UDP 1686052607 203.0.113.1 50000 typ srflx raddr 192.168.1.1 rport 12345",
|
||||
"sdpMid": "0",
|
||||
|
||||
Reference in New Issue
Block a user