generated from unai/python_boilerplate
Add unit tests for all modules including config, main, playlist, and server
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user