File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
tests/sentry/seer/endpoints Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -112,16 +112,21 @@ def test_generic_exceptions_return_500(self) -> None:
112112 path = self ._get_path ("get_organization_slug" )
113113 data : dict [str , Any ] = {"args" : {"org_id" : 1 }, "meta" : {}}
114114
115- with patch (
116- "sentry.seer.endpoints.seer_rpc.SeerRpcServiceEndpoint._dispatch_to_local_method"
117- ) as mock_dispatch :
118- mock_dispatch .side_effect = RuntimeError ("Unexpected internal error" )
119-
120- response = self .client .post (
121- path , data = data , HTTP_AUTHORIZATION = self .auth_header (path , data )
122- )
123-
124- assert response .status_code == 500
115+ for is_test_environment in [True , False ]:
116+ with patch (
117+ "sentry.seer.endpoints.seer_rpc.in_test_environment" ,
118+ return_value = is_test_environment ,
119+ ):
120+ with patch (
121+ "sentry.seer.endpoints.seer_rpc.SeerRpcServiceEndpoint._dispatch_to_local_method"
122+ ) as mock_dispatch :
123+ mock_dispatch .side_effect = RuntimeError ("Unexpected internal error" )
124+
125+ response = self .client .post (
126+ path , data = data , HTTP_AUTHORIZATION = self .auth_header (path , data )
127+ )
128+
129+ assert response .status_code == 500
125130
126131
127132class TestSeerRpcMethods (APITestCase ):
You can’t perform that action at this time.
0 commit comments