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

Function test_session_model

tests/unit/sessions/test_models.py:67–80  ·  view source on GitHub ↗

Test equivalence of SessionModel instances created directly and from camelCase, and snake_case kwargs.

(
    session_direct: SessionModel,
    session_args_camel: dict,
    session_args_snake: dict,
)

Source from the content-addressed store, hash-verified

65
66
67def test_session_model(
68 session_direct: SessionModel,
69 session_args_camel: dict,
70 session_args_snake: dict,
71) -> None:
72 """Test equivalence of SessionModel instances created directly and from camelCase, and snake_case kwargs."""
73 session_camel = SessionModel(**session_args_camel)
74 session_snake = SessionModel(**session_args_snake)
75
76 assert session_direct == session_camel == session_snake
77 assert session_direct.id == session_camel.id == session_snake.id == 'test_session'
78
79 # Check that max_age is correctly parsed into a timedelta object
80 assert session_direct.max_age == session_camel.max_age == session_snake.max_age == timedelta(minutes=30)

Callers

nothing calls this directly

Calls 1

SessionModelClass · 0.90

Tested by

no test coverage detected