Skip to content

Commit 6777263

Browse files
committed
tests added
1 parent bf9dfc0 commit 6777263

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/test_routes.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,15 @@ def test_create_point(client):
321321

322322
# Test all params
323323
test_utils.test_route_wrong_params(client, route, get_full_data)
324+
325+
326+
def test_database_uri_path(client):
327+
app = client.application
328+
with app.app_context():
329+
base_dir = os.path.abspath(os.path.dirname(__file__))
330+
expected_db_path = os.path.join(base_dir, "data", "project.db")
331+
expected_uri = f"sqlite:///{expected_db_path}"
332+
333+
assert app.config["SQLALCHEMY_DATABASE_URI"] == expected_uri
334+
335+
assert os.path.exists(expected_db_path)

tests/test_utils_functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ def test_create_unique_data_folder(client):
9090
def test_save_all_viewables_and_return_info(client):
9191
app = client.application
9292
with app.app_context():
93+
base_dir = os.path.abspath(os.path.dirname(__file__))
94+
expected_db_path = os.path.join(base_dir, "data", "project.db")
95+
expected_uri = f"sqlite:///{expected_db_path}"
96+
97+
assert app.config["SQLALCHEMY_DATABASE_URI"] == expected_uri
98+
assert os.path.exists(expected_db_path)
99+
93100
geode_object = "BRep"
94101
data = geode_functions.load(geode_object, "./tests/data/test.og_brep")
95102
generated_id, data_path = utils_functions.create_unique_data_folder()

0 commit comments

Comments
 (0)