@@ -141,27 +141,14 @@ class TestRunURL:
141141 # during the execution of the decorated test function. The original value is restored
142142 # after the test completes.
143143
144+ # To check what happens in different environemnt configurations, see env_test.py
145+
144146 # Here we patch WORKFLOWAI_APP_URL to test the direct app URL case
145147 @patch ("workflowai.env.WORKFLOWAI_APP_URL" , "https://workflowai.hello" )
146148 def test_run_url (self , run1 : Run [_TestOutput ]):
147149 # The patched value is only active during this test method
148150 assert run1 .run_url == "https://workflowai.hello/_/agents/agent-id/runs/run-id"
149151
150- # Here we patch WORKFLOWAI_API_URL to test URL derivation from API URL
151- @patch ("workflowai.env.WORKFLOWAI_API_URL" , "https://api.workflowai.dev" )
152- def test_run_url_empty_env (self , run1 : Run [_TestOutput ]):
153- # When WORKFLOWAI_API_URL is set to api.workflowai.dev, the app URL should be workflowai.dev
154- # The patch is scoped only to this test method
155- assert run1 .run_url == "https://workflowai.dev/_/agents/agent-id/runs/run-id"
156-
157- # Multiple patches can be stacked - they are applied from bottom to top
158- # Both patches are only active for the duration of this test method
159- @patch ("workflowai.env.WORKFLOWAI_API_URL" , None )
160- @patch ("workflowai.env.WORKFLOWAI_APP_URL" , None )
161- def test_run_url_no_api_url (self , run1 : Run [_TestOutput ]):
162- # When WORKFLOWAI_API_URL is not set, the app URL should default to workflowai.com
163- assert run1 .run_url == "https://workflowai.com/_/agents/agent-id/runs/run-id"
164-
165152
166153class TestFetchCompletions :
167154 """Tests for the fetch_completions method of the Run class."""
0 commit comments