Created better environment for testing
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user