MCPcopy Create free account
hub / github.com/StackStorm/st2 / use_user

Method use_user

st2tests/st2tests/api.py:165–177  ·  view source on GitHub ↗

Select a user which is to be used by the HTTP request following this call.

(self, user_db)

Source from the content-addressed store, hash-verified

163 cls.app = TestApp(cls.app_module.setup_app())
164
165 def use_user(self, user_db):
166 """
167 Select a user which is to be used by the HTTP request following this call.
168 """
169 if not user_db:
170 raise ValueError('"user_db" is mandatory')
171
172 mock_context = {
173 "user": user_db,
174 "auth_info": {"method": "authentication token", "location": "header"},
175 }
176 self.request_context_mock = mock.PropertyMock(return_value=mock_context)
177 Router.mock_context = self.request_context_mock
178
179
180class FunctionalTest(BaseFunctionalTest):

Calls

no outgoing calls