Spaces:
Running
Running
Download tests/test_notifications.py from basyx/MediaRouter: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/basyx/MediaRouter/resolve/main/tests/test_notifications.py
- Command line
-
hf download hf://spaces/basyx/MediaRouter/tests/test_notifications.py
-
curl -L -o test_notifications.py https://huggingface.co/spaces/basyx/MediaRouter/resolve/main/tests/test_notifications.py
786 Bytes
| import pytest | |
| from app.projects.repositories.notification_repository import NotificationRepository | |
| from app.projects.services.notification_service import NotificationService | |
| async def test_notification_preferences(db_session): | |
| repo = NotificationRepository(db_session) | |
| service = NotificationService(repo) | |
| workspace_id = "ws1" | |
| user_id = "user1" | |
| event = "approval_request" | |
| # Test initial fetch (should be empty or defaults) | |
| prefs = await service.get_preferences(workspace_id, user_id) | |
| # Test update | |
| await service.update_preference(workspace_id, user_id, event, False) | |
| prefs = await service.get_preferences(workspace_id, user_id) | |
| assert any(p['event_type'] == event and not p['enabled'] for p in prefs) | |