Feat: add e2e test for api
This commit is contained in:
@@ -20,7 +20,7 @@ from backend.repository.tribe_sqlite_repository import TribeSQLiteRepository
|
||||
# session = sessionmaker(bind=engine)()
|
||||
# tribe_repo = TribeSQLAlchemyRepository(session)
|
||||
|
||||
conn = sqlite3.connect(":memory:")
|
||||
conn = sqlite3.connect("sqlite.db")
|
||||
create_db(conn)
|
||||
|
||||
tribe_repo = TribeSQLiteRepository(conn)
|
||||
|
16
backend/config.py
Normal file
16
backend/config.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
import sqlite3
|
||||
|
||||
from backend.adapters.sqlite import create_db
|
||||
|
||||
|
||||
def sqlite_conn(sqlite_file: str = ":memory"):
|
||||
conn = sqlite3.connect(sqlite_file)
|
||||
create_db(conn)
|
||||
return conn
|
||||
|
||||
|
||||
def get_api_url():
|
||||
host = os.environ.get("API_HOST", "localhost")
|
||||
port = 8000 if host == "localhost" else 80
|
||||
return f"http://{host}:{port}"
|
Reference in New Issue
Block a user