HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/testing/user_notify.py

15 lines
422 B
Python
Raw Normal View History

2026-01-03 14:54:18 +01:00
from typing import Any
class UserNotify:
def __init__(self) -> None:
self.messages: list[str] = []
def __call__(self, message: str, **kwargs) -> None:
self.messages.append(message)
def contains(self, needle: Any) -> bool:
"""Check if any of the messages contain the given substring."""
return isinstance(needle, str) and any(needle in message for message in self.messages)