Add more tests

This commit is contained in:
2023-01-19 04:05:35 +01:00
parent 82bf97491d
commit f39c9056fd
5 changed files with 177 additions and 6 deletions

View File

@ -64,4 +64,4 @@ def entry_is_blacklisted(entry_to_check: Entry) -> bool:
def convert_to_md(thing: str) -> str:
"""Discord does not support tables so we need to remove them from the markdown."""
logger.debug(f"Converting {thing} to markdown.")
return markdownify(thing, strip=["table", "thead", "tbody", "tr", "th", "td"])
return markdownify(thing, strip=["table", "thead", "tbody", "tr", "th", "td"]) if thing else ""

View File

@ -67,10 +67,6 @@ def get_reader(custom_location: str = "") -> Reader:
db_location: str = get_db_location(custom_location)
logger.debug(f"Database location: {db_location}")
if not os.path.exists(db_location):
logger.error("Database does not exist.")
raise FileNotFoundError("Database does not exist.")
return make_reader(url=db_location)