major refactor (untested)

This commit is contained in:
Aron Petau 2025-12-27 11:59:04 +01:00
parent a29412b4da
commit a77a0c0393
22 changed files with 1037 additions and 24 deletions

62
tests/test_handlers.py Normal file
View file

@ -0,0 +1,62 @@
import pytest
from handlers.howoge_handler import HowogeHandler
from handlers.gewobag_handler import GewobagHandler
from handlers.degewo_handler import DegewoHandler
from handlers.gesobau_handler import GesobauHandler
from handlers.stadtundland_handler import StadtUndLandHandler
from handlers.wbm_handler import WBMHandler
from unittest.mock import AsyncMock
@pytest.mark.asyncio
async def test_howoge_handler():
context = AsyncMock()
handler = HowogeHandler(context)
listing = {"link": "https://www.howoge.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result
@pytest.mark.asyncio
async def test_gewobag_handler():
context = AsyncMock()
handler = GewobagHandler(context)
listing = {"link": "https://www.gewobag.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result
@pytest.mark.asyncio
async def test_degewo_handler():
context = AsyncMock()
handler = DegewoHandler(context)
listing = {"link": "https://www.degewo.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result
@pytest.mark.asyncio
async def test_gesobau_handler():
context = AsyncMock()
handler = GesobauHandler(context)
listing = {"link": "https://www.gesobau.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result
@pytest.mark.asyncio
async def test_stadtundland_handler():
context = AsyncMock()
handler = StadtUndLandHandler(context)
listing = {"link": "https://www.stadtundland.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result
@pytest.mark.asyncio
async def test_wbm_handler():
context = AsyncMock()
handler = WBMHandler(context)
listing = {"link": "https://www.wbm.de/example"}
result = {"success": False}
await handler.apply(listing, result)
assert "success" in result