Orchestrata Ultimate › Tests › Reference › session › test_session_context

Tests reference — tests/session/test_session_context.py

Module of tests/session, split out because the directory page would be too large.

Prose pending.

tests/session/test_session_context.py

source · 48 tests · 797 lines

Comprehensive tests for context.py - ContextFileManager class.

Covers: session.context, session.models

Kind Name Line Description
class TestContextManagerInit 60 Test ContextFileManager initialization.
method TestContextManagerInit.test_init_with_path_string 63 Test initialization with string path.
method TestContextManagerInit.test_init_with_path_object 68 Test initialization with Path object.
method TestContextManagerInit.test_jinja_env_initialized 75 Test Jinja environment is set up.
method TestContextManagerInit.test_constants 79 Test class constants.
class TestFileExists 90 Test file_exists() method.
method TestFileExists.test_file_not_exists 93 Test when context doesn't exist.
method TestFileExists.test_file_exists 97 Test when context exists.
class TestInitialize 105 Test initialize() method.
method TestInitialize.test_initialize_default_state 108 Test initialize with default state.
method TestInitialize.test_initialize_custom_state 114 Test initialize with custom state.
method TestInitialize.test_initialize_creates_file 126 Test initialize creates file.
class TestRead 136 Test read() method.
method TestRead.test_read_nonexistent_file 139 Test reading when file doesn't exist.
method TestRead.test_read_existing_file 144 Test reading existing file.
method TestRead.test_read_preserves_state 150 Test read preserves current state.
class TestWrite 163 Test write() method.
method TestWrite.test_write_creates_file 166 Test write creates file.
method TestWrite.test_write_with_sessions 172 Test write with sessions.
method TestWrite.test_write_with_work_items 190 Test write with work items.
class TestReadState 207 Test read_state() method.
method TestReadState.test_read_state 210 Test getting current state.
class TestUpdateState 219 Test update_state() method.
method TestUpdateState.test_update_single_field 222 Test updating single field.
method TestUpdateState.test_update_multiple_fields 228 Test updating multiple fields.
method TestUpdateState.test_update_nonexistent_field 240 Test updating nonexistent field is ignored.
class TestReadSessions 253 Test read_sessions() method.
method TestReadSessions.test_read_sessions_empty 256 Test getting sessions when none exist.
method TestReadSessions.test_read_sessions_with_data 261 Test getting sessions with data.
class TestReadLatestSession 270 Test read_latest_session() method.
method TestReadLatestSession.test_read_latest_session_none 273 Test when no sessions exist.
method TestReadLatestSession.test_read_latest_session_exists 278 Test when session exists.
class TestAddSession 289 Test add_session() method.
method TestAddSession.test_add_session 292 Test adding a session.
method TestAddSession.test_add_multiple_sessions 305 Test adding multiple sessions.
class TestUpdateSession 323 Test update_session() method.
method TestUpdateSession.test_update_session_exists 326 Test updating existing session.
method TestUpdateSession.test_update_session_not_exists 331 Test updating nonexistent session.
method TestUpdateSession.test_update_session_nonexistent_field 336 Test updating with nonexistent field.
class TestReadWorkItems 347 Test read_work_items() method.
method TestReadWorkItems.test_read_work_items_empty 350 Test getting items when none exist.
method TestReadWorkItems.test_read_work_items_with_data 355 Test getting items with data.
class TestAddWorkItem 367 Test add_work_item() method.
method TestAddWorkItem.test_add_work_item 370 Test adding a work item.
class TestCompleteWorkItem 383 Test complete_work_item() method.
method TestCompleteWorkItem.test_complete_item_exists 386 Test completing existing item.
method TestCompleteWorkItem.test_complete_item_not_exists 394 Test completing nonexistent item.
class TestParse 403 Test _parse() method.
method TestParse.test_parse_empty_content 406 Test parsing empty content.
method TestParse.test_parse_current_state 411 Test parsing current state.
method TestParse.test_parse_carryover_tasks 422 Test parsing carryover tasks.
method TestParse.test_parse_sessions 431 Test parsing sessions.
class TestArchiveBehavior 448 Test archiving behavior.
method TestArchiveBehavior.test_maybe_archive_not_triggered 451 Test archive not triggered for small content.
method TestArchiveBehavior.test_archive_old_sessions 466 Test archiving old sessions when many exist.
class TestContextManagerIntegration 491 Integration tests for ContextFileManager.
method TestContextManagerIntegration.test_full_workflow 494 Test complete context workflow.
method TestContextManagerIntegration.test_roundtrip_preservation 536 Test data survives save/load cycle.
method TestContextManagerIntegration.test_multiple_sessions_workflow 558 Test multiple session workflow.
method TestContextManagerIntegration.test_work_item_workflow 580 Test work item workflow.
class TestArchiveFunctionality 608 Test session archiving functionality.
method TestArchiveFunctionality.test_archive_when_many_sessions 611 Test that old sessions are archived when limit exceeded.
method TestArchiveFunctionality.test_archive_with_existing_history 636 Test archiving when history file already exists.
method TestArchiveFunctionality.test_archive_not_triggered_below_limit 661 Test that archiving doesn't happen below limit.
class TestDateParsingErrorHandling 689 Test handling of invalid date formats in context parsing.
method TestDateParsingErrorHandling.test_parse_invalid_date_format 692 Test parsing session with invalid date format uses current time.
class TestLineLimitArchive 746 Test archiving when line limit is exceeded.
method TestLineLimitArchive.test_archive_when_line_limit_exceeded 749 Test that archiving is triggered when line limit exceeded.