62 lines
No EOL
2 KiB
Python
62 lines
No EOL
2 KiB
Python
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 |