Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jun 27, 2024
1 parent d10614a commit 485d2f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions stac_fastapi/pgstac/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""Postgres API configuration."""

from typing import List, Type
from urllib.parse import quote

from urllib.parse import quote_plus as quote

from pydantic import BaseModel
from pydantic_settings import SettingsConfigDict
Expand Down
8 changes: 3 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import time
from typing import Callable, Dict
from urllib.parse import quote_plus as quote
from urllib.parse import urljoin

import asyncpg
Expand Down Expand Up @@ -55,9 +56,7 @@ def database(postgresql_proc):
version=postgresql_proc.version,
password="a2Vw:yk=)CdSis[fek]tW=/o",
) as jan:
connection = (
f"postgresql://{jan.user}:{jan.password}@{jan.host}:{jan.port}/{jan.dbname}"
)
connection = f"postgresql://{jan.user}:{quote(jan.password)}@{jan.host}:{jan.port}/{jan.dbname}"
with PgstacDB(dsn=connection) as db:
migrator = Migrate(db)
version = migrator.run_migration()
Expand All @@ -68,7 +67,7 @@ def database(postgresql_proc):

@pytest.fixture(autouse=True)
async def pgstac(database):
connection = f"postgresql://{database.user}:{database.password}@{database.host}:{database.port}/{database.dbname}"
connection = f"postgresql://{database.user}:{quote(database.password)}@{database.host}:{database.port}/{database.dbname}"
yield
conn = await asyncpg.connect(dsn=connection)
await conn.execute(
Expand Down Expand Up @@ -99,7 +98,6 @@ async def pgstac(database):
)
def api_client(request, database):
hydrate, prefix, response_model = request.param

api_settings = Settings(
postgres_user=database.user,
postgres_pass=database.password,
Expand Down

0 comments on commit 485d2f0

Please sign in to comment.