import asyncio
from routes import emoji_routes
def _emoji_endpoint():
router = emoji_routes.setup_emoji_routes()
for route in router.routes:
if route.path == "/api/emoji/{code}.svg" and "GET" in route.methods:
return route.endpoint
raise AssertionError("emoji route not found")
def test_svg_safety_rejects_active_or_external_svg_content():
assert emoji_routes._is_safe_svg(
b''
)
assert not emoji_routes._is_safe_svg(b'')
assert not emoji_routes._is_safe_svg(b'')
assert not emoji_routes._is_safe_svg(b'')
assert not emoji_routes._is_safe_svg(b"