Merge branch 'e2eTesting' of https://mygit.wmg.warwick.ac.uk/u5500327/wmgzon into e2eTesting
This commit is contained in:
commit
11ce2f16a4
@ -12,7 +12,7 @@ class DatabaseController(ABC):
|
||||
__db_name = "wmgzon.db"
|
||||
|
||||
# Use test file if necessary
|
||||
if os.environ.get("ENVIRON") == "test":
|
||||
if os.environ.get("ENVIRON", "test") == "test":
|
||||
__db_name = "test_" + __db_name
|
||||
|
||||
__sqlitefile = __data_dir + __db_name
|
||||
|
@ -26,7 +26,7 @@ def create_connection(path: str, filename: str):
|
||||
print("Table creation complete")
|
||||
|
||||
# Populate with test data if we are in Test Mode
|
||||
if os.environ.get("ENVIRON") == "test":
|
||||
if os.environ.get("ENVIRON", "test") == "test":
|
||||
sql = open("scripts/test_data.sql", "r")
|
||||
conn.executescript(sql.read())
|
||||
|
||||
@ -43,7 +43,7 @@ def run():
|
||||
db_name = r"wmgzon.db"
|
||||
|
||||
# Check for test environ
|
||||
if os.environ.get("ENVIRON") == "test":
|
||||
if os.environ.get("ENVIRON", "test") == "test":
|
||||
# Remove the original test database
|
||||
print("TEST ENVIRONMENT ACTIVE")
|
||||
db_name = "test_" + db_name
|
||||
|
Loading…
Reference in New Issue
Block a user