Merge branch 'e2eTesting' of https://mygit.wmg.warwick.ac.uk/u5500327/wmgzon into e2eTesting

This commit is contained in:
Luke Else 2024-02-24 14:09:34 +00:00
commit 11ce2f16a4
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ class DatabaseController(ABC):
__db_name = "wmgzon.db" __db_name = "wmgzon.db"
# Use test file if necessary # Use test file if necessary
if os.environ.get("ENVIRON") == "test": if os.environ.get("ENVIRON", "test") == "test":
__db_name = "test_" + __db_name __db_name = "test_" + __db_name
__sqlitefile = __data_dir + __db_name __sqlitefile = __data_dir + __db_name

View File

@ -26,7 +26,7 @@ def create_connection(path: str, filename: str):
print("Table creation complete") print("Table creation complete")
# Populate with test data if we are in Test Mode # 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") sql = open("scripts/test_data.sql", "r")
conn.executescript(sql.read()) conn.executescript(sql.read())
@ -43,7 +43,7 @@ def run():
db_name = r"wmgzon.db" db_name = r"wmgzon.db"
# Check for test environ # Check for test environ
if os.environ.get("ENVIRON") == "test": if os.environ.get("ENVIRON", "test") == "test":
# Remove the original test database # Remove the original test database
print("TEST ENVIRONMENT ACTIVE") print("TEST ENVIRONMENT ACTIVE")
db_name = "test_" + db_name db_name = "test_" + db_name