Move things away from main and refactor things

This commit is contained in:
2023-01-28 21:11:20 +01:00
parent e571ad9ee2
commit fa061782f4
6 changed files with 127 additions and 246 deletions

View File

@ -3,7 +3,7 @@ import tempfile
from pathlib import Path
from typing import Iterable
from reader import EntrySearchResult, Feed, Reader, make_reader
from reader import Feed, Reader, make_reader
from discord_rss_bot.search import create_html_for_search_results
@ -39,11 +39,8 @@ def test_create_html_for_search_results() -> None:
reader.enable_search()
reader.update_search()
# Get the HTML for the search results.
search_results: Iterable[EntrySearchResult] = reader.search_entries("a", feed=feed) # type: ignore
# Create the HTML and check if it is not empty.
search_html: str = create_html_for_search_results(search_results, reader)
search_html: str = create_html_for_search_results("a", reader)
assert search_html is not None
assert len(search_html) > 10