Skip to content

Commit a24dbaa

Browse files
committed
fix(web-backend): Fix direct run paths
1 parent 096f959 commit a24dbaa

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Note: The tests and code coverage are only for the core module. The web frontend
8989
cd core/nurse_scheduling
9090
# development mode
9191
fastapi dev serve.py
92+
93+
cd ..
9294
# run curl (needs to be run after the server is running)
9395
./tests/test_serve_curl.sh
9496
# run serve tests (don't need to be run after the server is running)

core/tests/test_schedule.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
import io
2222
import logging
2323
import os
24+
import sys
25+
# Add the project root to the Python path so imports will work when running directly
26+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
2427

2528
import nurse_scheduling
2629
import pandas

core/tests/test_serve.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
# Pytest tests for nurse scheduling FastAPI server.
2121
# Based on the FastAPI Testing guide: https://fastapi.tiangolo.com/tutorial/testing/
2222

23+
import os
24+
import sys
25+
# Add the project root to the Python path so imports will work when running directly
26+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
2327
import pytest
2428
from pathlib import Path
2529
from fastapi.testclient import TestClient
@@ -216,7 +220,7 @@ def test_empty_yaml_content(self):
216220
)
217221

218222
# Should return an error for empty content
219-
assert response.status_code == 500
223+
assert response.status_code == 400
220224

221225
def test_invalid_yaml_syntax(self):
222226
"""Test with invalid YAML syntax."""

0 commit comments

Comments
 (0)