#11 Starting on the creation of an end to end test environment
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user