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

Function token

tests/integration/test_state_inheritance.py:246–265  ·  view source on GitHub ↗

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

(state_inheritance: AppHarness, driver: WebDriver)

Source from the content-addressed store, hash-verified

244
245@pytest.fixture
246def token(state_inheritance: AppHarness, driver: WebDriver) -> str:
247 """Get a function that returns the active token.
248
249 Args:
250 state_inheritance: harness for StateInheritance app.
251 driver: WebDriver instance.
252
253 Returns:
254 The token for the connected client
255 """
256 assert state_inheritance.app_instance is not None
257 token_input = AppHarness.poll_for_or_raise_timeout(
258 lambda: driver.find_element(By.ID, "token")
259 )
260
261 # wait for the backend connection to send the token
262 token = state_inheritance.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2)
263 assert token is not None
264
265 return token
266
267
268def test_state_inheritance(

Callers

nothing calls this directly

Calls 2

poll_for_valueMethod · 0.80

Tested by

no test coverage detected