@@ -120,36 +120,29 @@ def test__given_use_modal_env_false__then_returns_gcp_api(
120120 # Then
121121 assert isinstance (api , SimulationAPI )
122122
123- def test__given_use_modal_env_not_set__then_returns_gcp_api (
123+ def test__given_use_modal_env_not_set__then_returns_modal_api (
124124 self ,
125125 mock_factory_logger ,
126126 ):
127- # Given
127+ # Given - default is now Modal when env var is not set
128128 import os
129129
130130 env_copy = dict (os .environ )
131131 env_copy .pop ("USE_MODAL_SIMULATION_API" , None )
132- env_copy ["GOOGLE_APPLICATION_CREDENTIALS" ] = "/path/to/creds.json"
133132
134133 with patch .dict ("os.environ" , env_copy , clear = True ):
135- with patch (
136- "policyengine_api.libs.simulation_api.executions_v1.ExecutionsClient"
137- ):
138- with patch (
139- "policyengine_api.libs.simulation_api.workflows_v1.WorkflowsClient"
140- ):
141- from policyengine_api .libs .simulation_api_factory import (
142- get_simulation_api ,
143- )
144- from policyengine_api .libs .simulation_api import (
145- SimulationAPI ,
146- )
134+ from policyengine_api .libs .simulation_api_factory import (
135+ get_simulation_api ,
136+ )
137+ from policyengine_api .libs .simulation_api_modal import (
138+ SimulationAPIModal ,
139+ )
147140
148- # When
149- api = get_simulation_api ()
141+ # When
142+ api = get_simulation_api ()
150143
151- # Then
152- assert isinstance (api , SimulationAPI )
144+ # Then
145+ assert isinstance (api , SimulationAPIModal )
153146
154147 def test__given_use_modal_env_false__then_logs_gcp_selection (
155148 self ,
@@ -189,11 +182,11 @@ def test__given_gcp_selected_without_credentials__then_raises_error(
189182 self ,
190183 mock_factory_logger ,
191184 ):
192- # Given
185+ # Given - explicitly select GCP without credentials
193186 import os
194187
195188 env_copy = dict (os .environ )
196- env_copy . pop ( "USE_MODAL_SIMULATION_API" , None )
189+ env_copy [ "USE_MODAL_SIMULATION_API" ] = "false"
197190 env_copy .pop ("GOOGLE_APPLICATION_CREDENTIALS" , None )
198191
199192 with patch .dict ("os.environ" , env_copy , clear = True ):
0 commit comments