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

Function session_direct

tests/unit/sessions/test_models.py:14–28  ·  view source on GitHub ↗

Provide a SessionModel instance directly using fixed parameters.

()

Source from the content-addressed store, hash-verified

12
13@pytest.fixture
14def session_direct() -> SessionModel:
15 """Provide a SessionModel instance directly using fixed parameters."""
16 return SessionModel(
17 id='test_session',
18 max_age=timedelta(minutes=30),
19 user_data={'user_key': 'user_value'},
20 max_error_score=3.0,
21 error_score_decrement=0.5,
22 created_at=SESSION_CREATED_AT,
23 usage_count=0,
24 max_usage_count=10,
25 error_score=0.0,
26 cookies=[CookieParam({'name': 'cookie_key', 'value': 'cookie_value'})],
27 blocked_status_codes=[401, 403, 429],
28 )
29
30
31@pytest.fixture

Callers

nothing calls this directly

Calls 2

SessionModelClass · 0.90
CookieParamClass · 0.90

Tested by

no test coverage detected