Skip to content

Commit e20995e

Browse files
committed
moving tests folder into src folder
1 parent 1ca693b commit e20995e

72 files changed

Lines changed: 68 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
requires = ["setuptools"]
33
build-backend = "setuptools.build_meta"
44

5-
65
[project]
76
name = "OpenGeodeWeb-Back"
87
version = "0.0.0"
@@ -21,6 +20,9 @@ classifiers = [
2120
"Homepage" = "https://github.com/Geode-solutions/OpenGeodeWeb-Back"
2221
"Bug Tracker" = "https://github.com/Geode-solutions/OpenGeodeWeb-Back/issues"
2322

23+
[project.scripts]
24+
opengeodeweb-back = "opengeodeweb_back.app:run_server"
25+
2426
[tool.setuptools.dynamic]
2527
dependencies = { file = ["requirements.txt"] }
2628

requirements-internal.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile requirements-internal.in
6+
#
7+
blinker==1.9.0
8+
# via
9+
# flask
10+
# opengeodeweb-microservice
11+
click==8.3.0
12+
# via
13+
# flask
14+
# opengeodeweb-microservice
15+
fastjsonschema==2.21.1
16+
# via opengeodeweb-microservice
17+
flask==3.1.2
18+
# via
19+
# flask-sqlalchemy
20+
# opengeodeweb-microservice
21+
flask-sqlalchemy==3.1.1
22+
# via opengeodeweb-microservice
23+
greenlet==3.2.4
24+
# via
25+
# opengeodeweb-microservice
26+
# sqlalchemy
27+
itsdangerous==2.2.0
28+
# via
29+
# flask
30+
# opengeodeweb-microservice
31+
jinja2==3.1.6
32+
# via
33+
# flask
34+
# opengeodeweb-microservice
35+
markupsafe==3.0.3
36+
# via
37+
# flask
38+
# jinja2
39+
# opengeodeweb-microservice
40+
# werkzeug
41+
opengeodeweb-microservice==1.0.3
42+
# via -r requirements-internal.in
43+
sqlalchemy==2.0.43
44+
# via
45+
# flask-sqlalchemy
46+
# opengeodeweb-microservice
47+
typing-extensions==4.15.0
48+
# via
49+
# opengeodeweb-microservice
50+
# sqlalchemy
51+
werkzeug==3.1.3
52+
# via
53+
# flask
54+
# opengeodeweb-microservice

src/opengeodeweb_back/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from flask_cors import cross_origin
1010
from werkzeug.exceptions import HTTPException
1111

12-
from src.opengeodeweb_back import utils_functions, app_config
13-
from src.opengeodeweb_back.routes import blueprint_routes
14-
from src.opengeodeweb_back.routes.models import blueprint_models
12+
from opengeodeweb_back import utils_functions, app_config
13+
from opengeodeweb_back.routes import blueprint_routes
14+
from opengeodeweb_back.routes.models import blueprint_models
1515
from opengeodeweb_microservice.database.connection import init_database
1616

1717

File renamed without changes.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import pytest
1010

1111
# Local application imports
12-
from src.opengeodeweb_back.app import app
13-
from src.opengeodeweb_back import app_config
12+
from opengeodeweb_back.app import app
13+
14+
# from opengeodeweb_back import app_config
1415
from opengeodeweb_microservice.database.connection import init_database
1516

1617
TEST_ID = "1"
@@ -21,14 +22,17 @@ def configure_test_environment() -> Generator[None, None, None]:
2122
base_path = Path(__file__).parent
2223
test_data_path = base_path / "data"
2324

25+
# Clean up any existing test data
2426
shutil.rmtree("./data", ignore_errors=True)
2527
shutil.copytree(test_data_path, f"./data/{TEST_ID}/", dirs_exist_ok=True)
2628

29+
# Configure app for testing
2730
app.config["TESTING"] = True
2831
app.config["SERVER_NAME"] = "TEST"
2932
app.config["DATA_FOLDER_PATH"] = "./data/"
3033
app.config["UPLOAD_FOLDER"] = "./tests/data/"
3134

35+
# Setup database
3236
db_path = os.path.join(base_path, "data", "project.db")
3337
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///{db_path}"
3438

@@ -39,6 +43,8 @@ def configure_test_environment() -> Generator[None, None, None]:
3943
os.environ["TEST_DB_PATH"] = str(db_path)
4044

4145
yield
46+
47+
# Cleanup after tests
4248
tmp_data_path = app.config.get("DATA_FOLDER_PATH")
4349
if tmp_data_path and os.path.exists(tmp_data_path):
4450
shutil.rmtree(tmp_data_path, ignore_errors=True)

0 commit comments

Comments
 (0)