renamed 'archive_media' and 'media' to avoid name collision, changed scope of test fixture controller to 'function' so that db is fresh for each executed test

This commit is contained in:
Tristan Lee
2022-03-09 13:19:35 -06:00
parent 739e1d8484
commit 6cf3b8842d
20 changed files with 130 additions and 125 deletions

View File

@@ -1,4 +1,5 @@
from sqlalchemy import create_engine
from loguru import logger
from cisticola.base import Channel
from cisticola.scraper import (
@@ -12,6 +13,8 @@ from cisticola.scraper import (
TelegramTelethonScraper,
TwitterScraper)
logger.add("../test.log")
test_channels = [
Channel(
id=0,
@@ -118,12 +121,12 @@ scrapers = [
OdyseeScraper(),
RumbleScraper(),
TelegramSnscrapeScraper(),
TwitterScraper()
TelegramTelethonScraper()]
TelegramTelethonScraper(),
TwitterScraper()]
controller.register_scrapers(scrapers)
engine = create_engine('sqlite:///test3.db')
controller.connect_to_db(engine)
controller.scrape_channels(test_channels, media = True)
controller.scrape_channels(test_channels, archive_media = False)