MCPcopy Create free account
hub / github.com/dot-agent/nextpy / test_initialize_with_state

Function test_initialize_with_state

tests/test_app.py:341–357  ·  view source on GitHub ↗

Test setting the state of an app. Args: test_state: The default state. token: a Token.

(test_state: Type[ATestState], token: str)

Source from the content-addressed store, hash-verified

339
340@pytest.mark.asyncio
341async def test_initialize_with_state(test_state: Type[ATestState], token: str):
342 """Test setting the state of an app.
343
344 Args:
345 test_state: The default state.
346 token: a Token.
347 """
348 app = App(state=test_state)
349 assert app.state == test_state
350
351 # Get a state for a given token.
352 state = await app.state_manager.get_state(token)
353 assert isinstance(state, test_state)
354 assert state.var == 0 # type: ignore
355
356 if isinstance(app.state_manager, StateManagerRedis):
357 await app.state_manager.close()
358
359
360@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

AppClass · 0.90
closeMethod · 0.80
get_stateMethod · 0.45

Tested by

no test coverage detected