Skip to content

Commit

Permalink
test: use setting vars for s3 endpoint and dev port
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jan 5, 2024
1 parent a4b8905 commit 48cd63b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/tests/test_projects_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from shapely.geometry import shape

from app.central.central_crud import create_odk_project
from app.config import settings
from app.db import db_models
from app.projects import project_crud, project_schemas
from app.tasks import tasks_crud
Expand Down Expand Up @@ -179,8 +180,11 @@ async def test_generate_appuser_files(db, project):
data_extracts,
)
assert data_extract_s3_path is not None
# Test url, but first sub alias for docker network
internal_file_path = f"http://s3:9000{data_extract_s3_path.split('7050')[1]}"
# Test url, but first sub localhost url with docker network for backend connection
internal_file_path = (
f"{settings.S3_ENDPOINT}"
f"{data_extract_s3_path.split(settings.FMTM_DEV_PORT)[1]}"
)
response = requests.head(internal_file_path, allow_redirects=True)
assert response.status_code < 400

Expand Down

0 comments on commit 48cd63b

Please sign in to comment.