feat(cloud-auth): require production credentials
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from cloud_api.app import create_app
|
||||
from cloud.control_config import CloudControlConfig
|
||||
from cloud.control_config import CloudConfigurationError, CloudControlConfig
|
||||
|
||||
|
||||
def test_create_app_returns_independent_cloud_application() -> None:
|
||||
@@ -31,3 +32,13 @@ def test_cloud_application_owns_database_lifecycle() -> None:
|
||||
assert events == []
|
||||
|
||||
assert events == ["closed"]
|
||||
|
||||
|
||||
def test_production_app_rejects_missing_credentials() -> None:
|
||||
with pytest.raises(CloudConfigurationError, match="credential"):
|
||||
create_app(
|
||||
config=CloudControlConfig(
|
||||
environment="production",
|
||||
database_url="postgresql://db/cloud",
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user