Initializes the environments for the app with the given database. Args: app_db (AppDB): The database for the app. Returns: List[AppEnvironmentDB]: A list of the initialized environments.
(
session: AsyncSession, app_db: AppDB
)
| 2328 | |
| 2329 | |
| 2330 | async def initialize_environments( |
| 2331 | session: AsyncSession, app_db: AppDB |
| 2332 | ) -> List[AppEnvironmentDB]: |
| 2333 | """ |
| 2334 | Initializes the environments for the app with the given database. |
| 2335 | |
| 2336 | Args: |
| 2337 | app_db (AppDB): The database for the app. |
| 2338 | |
| 2339 | Returns: |
| 2340 | List[AppEnvironmentDB]: A list of the initialized environments. |
| 2341 | """ |
| 2342 | |
| 2343 | environments = [] |
| 2344 | for env_name in ["development", "staging", "production"]: |
| 2345 | env = await create_environment(session=session, name=env_name, app_db=app_db) |
| 2346 | environments.append(env) |
| 2347 | return environments |
| 2348 | |
| 2349 | |
| 2350 | async def create_environment( |
no test coverage detected