feat: add test for database and rss engine.

This commit is contained in:
EstrellaXD
2023-08-05 20:19:06 +08:00
parent 80ea9ec657
commit f99056c8d6
8 changed files with 91 additions and 35 deletions

View File

@@ -2,13 +2,18 @@ import re
import logging
from module.models import Bangumi, RSSItem, Torrent
from module.network import RequestContent, TorrentInfo
from module.network import RequestContent
from module.downloader import DownloadClient
from module.database.combine import Database
from module.database import Database, engine
logger = logging.getLogger(__name__)
class RSSEngine(Database):
def __init__(self, _engine=engine):
super().__init__(_engine)
@staticmethod
def _get_torrents(rss_link: str) -> list[Torrent]:
with RequestContent() as req: