Created better environment for testing

This commit is contained in:
2024-01-09 20:53:55 +00:00
parent 1df7ea856c
commit feaa253a01
5 changed files with 49 additions and 21 deletions

View File

@ -1,9 +1,18 @@
from abc import ABC, abstractmethod
from typing import Mapping, Any
import sqlite3
import os
class DatabaseController(ABC):
__sqlitefile = "./data/wmgzon.db"
__data_dir = "./data/"
__db_name = "wmgzon.db"
# Use test file if necessary
if os.environ.get("ENVIRON") == "test":
__db_name = "test_" + __db_name
__sqlitefile = __data_dir + __db_name
def __init__(self):
self._conn = None