Orchestrata Ultimate › Tests › Reference › session › test_session_portfolio

Tests reference — tests/session/test_session_portfolio.py

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

Prose pending.

tests/session/test_session_portfolio.py

source · 65 tests · 598 lines

Comprehensive tests for portfolio.py - PortfolioController class.

Covers: session.models, session.portfolio

Kind Name Line Description
class TestPortfolioControllerInit 60 Test PortfolioController initialization.
method TestPortfolioControllerInit.test_init_with_path_string 63 Test initialization with string path.
method TestPortfolioControllerInit.test_init_with_path_object 68 Test initialization with Path object.
method TestPortfolioControllerInit.test_file_name_constant 74 Test FILE_NAME constant.
class TestFileExists 82 Test file_exists() method.
method TestFileExists.test_file_not_exists 85 Test when portfolio doesn't exist.
method TestFileExists.test_file_exists 89 Test when portfolio exists.
class TestInitialize 97 Test initialize() method.
method TestInitialize.test_initialize_creates_file 100 Test initialize creates file.
method TestInitialize.test_initialize_returns_portfolio 105 Test initialize returns PortfolioData.
method TestInitialize.test_initialize_with_summary 111 Test initialize with summary.
method TestInitialize.test_initialize_content 116 Test portfolio content after initialize.
class TestLoad 126 Test load() method.
method TestLoad.test_load_nonexistent_raises 129 Test loading when file doesn't exist raises error.
method TestLoad.test_load_existing 134 Test loading existing portfolio.
method TestLoad.test_load_preserves_data 139 Test loading preserves portfolio data.
class TestAddProject 149 Test add_project() method.
method TestAddProject.test_add_project_no_portfolio_raises 152 Test adding project without portfolio raises error.
method TestAddProject.test_add_project_returns_ref 157 Test add_project returns PortfolioProjectRef.
method TestAddProject.test_add_project_with_summary 163 Test add_project with summary.
method TestAddProject.test_add_project_persists 168 Test add_project persists to file.
class TestRemoveProject 178 Test remove_project() method.
method TestRemoveProject.test_remove_project_no_portfolio 181 Test removing project without portfolio raises error.
method TestRemoveProject.test_remove_project_exists 186 Test removing existing project.
method TestRemoveProject.test_remove_project_not_exists 191 Test removing nonexistent project.
method TestRemoveProject.test_remove_project_persists 196 Test remove persists to file.
class TestListProjects 206 Test list_projects() method.
method TestListProjects.test_list_projects_no_portfolio 209 Test listing without portfolio raises error.
method TestListProjects.test_list_projects_empty 214 Test listing empty projects.
method TestListProjects.test_list_projects_with_data 219 Test listing projects with data.
class TestGetProject 229 Test get_project() method.
method TestGetProject.test_get_project_no_portfolio 232 Test getting project without portfolio raises error.
method TestGetProject.test_get_project_exists 237 Test getting existing project.
method TestGetProject.test_get_project_not_exists 245 Test getting nonexistent project.
class TestBeginSession 254 Test begin_session() method.
method TestBeginSession.test_begin_session_no_portfolio 257 Test beginning session without portfolio raises error.
method TestBeginSession.test_begin_session_returns_record 262 Test begin_session returns PortfolioSessionRecord.
method TestBeginSession.test_begin_session_sets_purpose 267 Test begin_session sets purpose.
method TestBeginSession.test_begin_session_with_objectives 272 Test begin_session with objectives.
method TestBeginSession.test_begin_session_increments_seq 277 Test begin_session increments sequence number.
method TestBeginSession.test_begin_session_persists 283 Test begin_session persists to file.
method TestBeginSession.test_begin_session_custom_model 289 Test begin_session with custom AI model.
class TestLinkProjectSession 298 Test link_project_session() method.
method TestLinkProjectSession.test_link_no_portfolio 301 Test linking without portfolio raises error.
method TestLinkProjectSession.test_link_to_existing_session 306 Test linking to existing session.
method TestLinkProjectSession.test_link_to_nonexistent_session 311 Test linking to nonexistent session.
class TestGetSession 320 Test get_session() method.
method TestGetSession.test_get_session_no_portfolio 323 Test getting session without portfolio raises error.
method TestGetSession.test_get_session_exists 328 Test getting existing session.
method TestGetSession.test_get_session_not_exists 336 Test getting nonexistent session.
class TestGetLatestSession 345 Test get_latest_session() method.
method TestGetLatestSession.test_get_latest_no_portfolio 348 Test getting latest without portfolio raises error.
method TestGetLatestSession.test_get_latest_no_sessions 353 Test getting latest when no sessions.
method TestGetLatestSession.test_get_latest_with_sessions 358 Test getting latest session.
class TestAddWork 370 Test add_work() method.
method TestAddWork.test_add_work_no_portfolio 373 Test adding work without portfolio raises error.
method TestAddWork.test_add_work_returns_item 378 Test add_work returns WorkItem.
method TestAddWork.test_add_work_with_priority 384 Test add_work with priority.
method TestAddWork.test_add_work_persists 389 Test add_work persists.
class TestPendingWork 399 Test pending_work() method.
method TestPendingWork.test_pending_work_no_portfolio 402 Test getting pending work without portfolio raises error.
method TestPendingWork.test_pending_work_empty 407 Test getting pending work when empty.
method TestPendingWork.test_pending_work_with_data 412 Test getting pending work with data.
class TestCompleteWork 422 Test complete_work() method.
method TestCompleteWork.test_complete_work_no_portfolio 425 Test completing work without portfolio raises error.
method TestCompleteWork.test_complete_work_exists 430 Test completing existing work.
method TestCompleteWork.test_complete_work_not_exists 436 Test completing nonexistent work.
method TestCompleteWork.test_complete_work_removes_from_pending 441 Test completed work is removed from pending.
class TestGetState 452 Test get_state() method.
method TestGetState.test_get_state_no_portfolio 455 Test getting state without portfolio raises error.
method TestGetState.test_get_state 460 Test getting state.
class TestUpdateState 469 Test update_state() method.
method TestUpdateState.test_update_state_no_portfolio 472 Test updating state without portfolio raises error.
method TestUpdateState.test_update_state 477 Test updating state.
method TestUpdateState.test_update_state_persists 482 Test update state persists.
method TestUpdateState.test_update_state_ignores_unknown 488 Test update_state ignores unknown fields.
class TestReport 504 Test report() method.
method TestReport.test_report_no_portfolio 507 Test report without portfolio raises error.
method TestReport.test_report_structure 512 Test report structure.
method TestReport.test_report_values 528 Test report values.
class TestPortfolioControllerIntegration 537 Integration tests for PortfolioController.
method TestPortfolioControllerIntegration.test_full_workflow 540 Test complete portfolio workflow.
method TestPortfolioControllerIntegration.test_multiple_sessions 573 Test multiple sessions workflow.
method TestPortfolioControllerIntegration.test_roundtrip_preservation 586 Test data survives save/load cycle.