#11 Added defaults to every fetch of 'ENVIRON' to ensure a value is available

This commit is contained in:
2024-02-24 08:47:57 +00:00
parent 0434d85ddb
commit c5b60f22da
2 changed files with 3 additions and 3 deletions

View File

@ -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