MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_session_get_state

Function test_session_get_state

tests/unit/sessions/test_session.py:40–49  ·  view source on GitHub ↗

Check if the session state is correctly retrievable in both dict and model forms.

(session: Session)

Source from the content-addressed store, hash-verified

38
39
40def test_session_get_state(session: Session) -> None:
41 """Check if the session state is correctly retrievable in both dict and model forms."""
42 session_state_dict = session.get_state(as_dict=True)
43 assert session_state_dict['id'] == 'test_session'
44
45 session_state_model = session.get_state(as_dict=False)
46 assert session_state_model.id == 'test_session'
47
48 session_2 = Session.from_model(session_state_model)
49 assert session_2.id == 'test_session'
50
51
52def test_mark_good(session: Session) -> None:

Callers

nothing calls this directly

Calls 2

from_modelMethod · 0.80
get_stateMethod · 0.45

Tested by

no test coverage detected