unai 128432f679
Some checks failed
CI/CD Pipeline / test-and-lint (push) Failing after 32s
CI/CD Pipeline / publish-container (push) Has been skipped
Add unit tests for all modules including config, main, playlist, and server
2026-02-01 18:47:32 +00:00

56 lines
1.2 KiB
Python

"""Configuración compartida para los tests de pytest."""
import pytest
@pytest.fixture
def sample_channels():
"""Fixture con datos de ejemplo de canales."""
return [
{
"name": "Channel 1",
"stream_id": 101,
"stream_icon": "http://example.com/icon1.png",
"category_id": "1",
},
{
"name": "Channel 2",
"stream_id": 102,
"stream_icon": "http://example.com/icon2.png",
"category_id": "2",
},
{
"name": "Channel 3",
"stream_id": 103,
"stream_icon": "",
"category_id": "",
},
]
@pytest.fixture
def empty_channels():
"""Fixture con lista vacía de canales."""
return []
@pytest.fixture
def minimal_channel():
"""Fixture con canal con campos mínimos."""
return [{"stream_id": 999}]
@pytest.fixture
def mock_settings(monkeypatch):
"""Fixture para mockear settings."""
class MockSettings:
host = "http://test-iptv.com"
username = "testuser"
password = "testpass"
port = 8080
update_interval = 60
output_file = "test_playlist.m3u"
return MockSettings()