add mobilede tests

This commit is contained in:
qananasikq
2026-04-29 19:13:18 +03:00
parent f00819a21c
commit 8f94828b29
11 changed files with 221 additions and 119 deletions

View File

@@ -4,17 +4,17 @@ import unittest
from types import SimpleNamespace
from unittest.mock import MagicMock, patch
from iaai_scraper.scraper import IAAIScraper
from iaai_scraper.core.config import Settings
from iaai_scraper.worker import tasks
from mobilede_scraper.scraper import MobiledeScraper
from mobilede_scraper.core.config import Settings
from mobilede_scraper.worker import tasks
class TestResilience(unittest.TestCase):
def _make_scraper(self) -> IAAIScraper:
def _make_scraper(self) -> MobiledeScraper:
s = Settings()
s.log_level = "CRITICAL"
s.database.url = "sqlite://"
return IAAIScraper(s)
return MobiledeScraper(s)
def test_update_task_progress_updates_global_marker(self) -> None:
redis_client = MagicMock()
@@ -60,11 +60,11 @@ class TestResilience(unittest.TestCase):
result = scraper._sync_listing_streaming(
make=None,
model=None,
lane="iaai_cars",
lane="MOBILEDE_cars",
limit=None,
effective_only_new=False,
started_at=0.0,
listing_url="https://www.iaai.com/Vehiclelisting/Cars?Make=TEST",
listing_url="https://www.MOBILEDE.com/Vehiclelisting/Cars?Make=TEST",
)
self.assertEqual(result["total"], 0)