Skip to content

Commit c0c1cf7

Browse files
committed
fixed test_environnement
Need to fix generic_protocols still
1 parent 33f12bf commit c0c1cf7

File tree

3 files changed

+71
-7
lines changed

3 files changed

+71
-7
lines changed

requirements.txt

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1-
wslink==1.12.4
2-
websocket_client==1.8.0
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
aiohappyeyeballs==2.6.1
8+
# via aiohttp
9+
aiohttp==3.13.0
10+
# via wslink
11+
aiosignal==1.4.0
12+
# via aiohttp
13+
attrs==25.4.0
14+
# via aiohttp
15+
contourpy==1.3.3
16+
# via matplotlib
17+
cycler==0.12.1
18+
# via matplotlib
19+
fonttools==4.60.1
20+
# via matplotlib
21+
frozenlist==1.8.0
22+
# via
23+
# aiohttp
24+
# aiosignal
25+
idna==3.10
26+
# via yarl
27+
kiwisolver==1.4.9
28+
# via matplotlib
29+
matplotlib==3.10.7
30+
# via vtk
31+
multidict==6.7.0
32+
# via
33+
# aiohttp
34+
# yarl
35+
numpy==2.3.3
36+
# via
37+
# contourpy
38+
# matplotlib
39+
packaging==25.0
40+
# via matplotlib
41+
pillow==11.3.0
42+
# via matplotlib
43+
propcache==0.4.1
44+
# via
45+
# aiohttp
46+
# yarl
47+
pyparsing==3.2.5
48+
# via matplotlib
49+
python-dateutil==2.9.0.post0
50+
# via matplotlib
51+
six==1.17.0
52+
# via python-dateutil
53+
typing-extensions==4.15.0
54+
# via aiosignal
355
vtk==9.5.2
56+
# via -r requirements.in
57+
websocket-client==1.8.0
58+
# via -r requirements.in
59+
wslink==1.12.4
60+
# via -r requirements.in
61+
yarl==1.22.0
62+
# via aiohttp

src/opengeodeweb_viewer/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ def _copy_test_assets(
5050

5151
def test_config() -> None:
5252
default_config()
53-
data_path = os.path.join(os.path.dirname(__file__), "..", "..", "tests", "data")
54-
os.environ["DATA_FOLDER_PATH"] = data_path
53+
if "DATA_FOLDER_PATH" not in os.environ:
54+
data_path = os.path.join(os.path.dirname(__file__), "..", "..", "tests", "data")
55+
os.environ["DATA_FOLDER_PATH"] = os.path.abspath(data_path)
56+
57+
data_path = os.environ["DATA_FOLDER_PATH"]
5558
db_file = os.path.join(data_path, "project.db")
5659
if not os.path.exists(db_file):
5760
open(db_file, "a").close()

src/tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class Starter(ProcessStarter):
164164

165165
# command to start process
166166
args = [
167-
"opengeodeweb_viewer",
167+
"opengeodeweb-viewer",
168168
]
169169

170170
return "vtkw_server", Starter, ServerMonitor
@@ -191,9 +191,11 @@ def server(xprocess: object) -> Generator[ServerMonitor, None, None]:
191191

192192
@pytest.fixture(scope="session", autouse=True)
193193
def configure_test_environment() -> Generator[None, None, None]:
194-
base_path = Path(__file__).parent
194+
project_root = Path(__file__).parent.parent.parent.absolute()
195+
os.environ["DATA_FOLDER_PATH"] = str(project_root / "tests" / "data")
196+
195197
config.test_config()
196-
db_path = base_path / "project.db"
198+
db_path = Path(os.environ["DATA_FOLDER_PATH"]) / "project.db"
197199
init_database(db_path=str(db_path))
198200
os.environ["TEST_DB_PATH"] = str(db_path)
199201

0 commit comments

Comments
 (0)