MCPcopy Index your code
hub / github.com/reflex-dev/reflex / token

Function token

tests/integration/test_background_task.py:260–280  ·  view source on GitHub ↗

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

(background_task: AppHarness, driver: WebDriver)

Source from the content-addressed store, hash-verified

258
259@pytest.fixture
260def token(background_task: AppHarness, driver: WebDriver) -> str:
261 """Get a function that returns the active token.
262
263 Args:
264 background_task: harness for BackgroundTask app.
265 driver: WebDriver instance.
266
267 Returns:
268 The token for the connected client
269 """
270 assert background_task.app_instance is not None
271
272 token_input = AppHarness.poll_for_or_raise_timeout(
273 lambda: driver.find_element(By.ID, "token")
274 )
275
276 # wait for the backend connection to send the token
277 token = background_task.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2)
278 assert token is not None
279
280 return token
281
282
283def test_background_task(

Callers

nothing calls this directly

Calls 2

poll_for_valueMethod · 0.80

Tested by

no test coverage detected