MCPcopy
hub / github.com/reflex-dev/reflex / token

Function token

tests/integration/test_computed_vars.py:164–183  ·  view source on GitHub ↗

Get a function that returns the active token. Args: computed_vars: harness for ComputedVars app. driver: WebDriver instance. Returns: The token for the connected client

(computed_vars: AppHarness, driver: WebDriver)

Source from the content-addressed store, hash-verified

162
163@pytest.fixture
164def token(computed_vars: AppHarness, driver: WebDriver) -> str:
165 """Get a function that returns the active token.
166
167 Args:
168 computed_vars: harness for ComputedVars app.
169 driver: WebDriver instance.
170
171 Returns:
172 The token for the connected client
173 """
174 assert computed_vars.app_instance is not None
175 token_input = AppHarness.poll_for_or_raise_timeout(
176 lambda: driver.find_element(By.ID, "token")
177 )
178
179 # wait for the backend connection to send the token
180 token = computed_vars.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2)
181 assert token is not None
182
183 return token
184
185
186@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

poll_for_valueMethod · 0.80

Tested by

no test coverage detected