Files
syn-chat-bot/.venv/lib/python3.9/site-packages/icalendar/tests/prop/test_vBinary.py
Hyungi Ahn c2257d3a86 fix: 포트 충돌 회피 — note_bridge 8098, intent_service 8099
Jellyfin(8096), OrbStack(8097) 포트 충돌으로 변경.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:53:55 +09:00

46 lines
1.2 KiB
Python

"""Test vBinary"""
import pytest
from icalendar import vBinary
from icalendar.parser import Parameters
def test_text():
txt = b"This is gibberish"
txt_ical = b"VGhpcyBpcyBnaWJiZXJpc2g="
assert vBinary(txt).to_ical() == txt_ical
assert vBinary.from_ical(txt_ical) == txt
def test_binary():
txt = b"Binary data \x13 \x56"
txt_ical = b"QmluYXJ5IGRhdGEgEyBW"
assert vBinary(txt).to_ical() == txt_ical
assert vBinary.from_ical(txt_ical) == txt
def test_param():
assert isinstance(vBinary("txt").params, Parameters)
assert vBinary("txt").params == {"VALUE": "BINARY", "ENCODING": "BASE64"}
def test_long_data():
"""Long data should not have line breaks, as that would interfere"""
txt = b"a" * 99
txt_ical = b"YWFh" * 33
assert vBinary(txt).to_ical() == txt_ical
assert vBinary.from_ical(txt_ical) == txt
def test_repr():
instance = vBinary("value")
assert repr(instance) == "vBinary(b'dmFsdWU=')"
def test_from_ical():
with pytest.raises(ValueError, match="Not valid base 64 encoding."):
vBinary.from_ical("value")
with pytest.raises(ValueError, match="Not valid base 64 encoding."):
vBinary.from_ical("áèਮ")