#11 Starting on the creation of an end to end test environment

This commit is contained in:
2024-02-23 18:24:57 +00:00
parent d056146a44
commit bcde471f33
8 changed files with 41 additions and 28 deletions

View File

@ -38,14 +38,19 @@ def create_connection(path: str, filename: str):
# Ensure a directory is created given a path to it
dir = r"./data/"
db_name = r"wmgzon.db"
if __name__ == "__main__":
run()
# Check for test environ
if os.environ.get("ENVIRON") == "test":
# Remove the original test database
print("TEST ENVIRONMENT ACTIVE")
db_name = "test_" + db_name
remove_file(dir + db_name)
def run():
""" Create the database for the application"""
dir = r"./data/"
db_name = r"wmgzon.db"
create_connection(dir, db_name)
# Check for test environ
if os.environ.get("ENVIRON") == "test":
# Remove the original test database
print("TEST ENVIRONMENT ACTIVE")
db_name = "test_" + db_name
remove_file(dir + db_name)
create_connection(dir, db_name)