"""
T-UC2: Immobilien — Machbarkeitsstudie.

Verifies that the workspace feature is available for the agent-based
real estate demo (UC2 runs via workspace, not a dedicated realestate instance).
"""

import pytest
from tests.demo.conftest import _getFeatureInstances


class TestRealEstateReadiness:

    def test_workspaceInstanceHappylife(self, db, mandateHappylife):
        """HappyLife must have a workspace instance for the agent demo."""
        mid = mandateHappylife.get("id")
        instances = _getFeatureInstances(db, mid, "workspace")
        assert len(instances) >= 1, "No workspace instance in HappyLife for UC2"

    def test_workspaceInstanceAlpina(self, db, mandateAlpina):
        """Alpina must have a workspace instance."""
        mid = mandateAlpina.get("id")
        instances = _getFeatureInstances(db, mid, "workspace")
        assert len(instances) >= 1, "No workspace instance in Alpina"
