Orchestrata Ultimate › Tests › Reference › session › test_session_cli_coverage
Tests reference — tests/session/test_session_cli_coverage.py
Module of tests/session, split out because the directory page would be too large.
Prose pending.
tests/session/test_session_cli_coverage.py
source · 22 tests · 499 lines
Covers: session.cli.main, session.context, session.models
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestFindProjectRoot |
132 | Cover the fallback in _find_project_root(). |
| method | TestFindProjectRoot.test_archive_without_root_falls_back_to_cwd |
135 | Without --root, the CLI walks up from cwd. If no context.json |
| class | TestArchiveRecover |
149 | Cover the archive --recover code path. |
| method | TestArchiveRecover.test_archive_recover_prints_json |
152 | archive --recover invokes recover_from_git and prints JSON. |
| method | TestArchiveRecover.test_archive_recover_with_git_repo_returns_zero |
167 | In a real git repo with no historical context.json, recover succeeds |
| class | TestStatusWithTestState |
208 | Status output must echo the test_state line when set. |
| method | TestStatusWithTestState.test_status_shows_test_state |
211 | ProjectState.test_state populated → 'Test state:' echoed. |
| class | TestListBrokenJson |
222 | Corrupt context.json triggers the OSError/ValueError/KeyError branch. |
| method | TestListBrokenJson.test_list_with_broken_json |
225 | A context.json file containing invalid data is logged and skipped. |
| class | TestKgContextConnectionFailure |
241 | KGC.connect() returning False → CLI exits 1. |
| method | TestKgContextConnectionFailure.test_query_file_neo4j_connection_failure |
244 | query file with bad Neo4j URI exits 1 (lines 293-296). |
| method | TestKgContextConnectionFailure.test_query_spec_neo4j_connection_failure |
257 | query spec also covers the failure branch. |
| class | TestQueryCommandsRealNeo4j |
273 | Exercise every query command against the live graph instance. |
| method | TestQueryCommandsRealNeo4j.test_query_file |
276 | query file path returns JSON (lines 304-309). |
| method | TestQueryCommandsRealNeo4j.test_query_spec |
290 | query spec returns JSON (lines 317-322). |
| method | TestQueryCommandsRealNeo4j.test_query_undocumented |
303 | query undocumented prints either 'all documented' or a table. |
| method | TestQueryCommandsRealNeo4j.test_query_untraced |
318 | query untraced (lines 348-360). |
| method | TestQueryCommandsRealNeo4j.test_query_unchecked |
332 | query unchecked (lines 367-380). |
| method | TestQueryCommandsRealNeo4j.test_query_search_results_or_empty |
346 | query search reaches the search code path (lines 389-401). |
| method | TestQueryCommandsRealNeo4j.test_query_search_with_limit_option |
370 | search --limit overrides the default limit (lines 389-401). |
| class | TestSyncCommand |
393 | Exercise the sync subcommand against real graph. |
| method | TestSyncCommand.test_sync_connection_failure |
396 | Bad Neo4j credentials → exit 1 (lines 234-236). |
| method | TestSyncCommand.test_sync_specs_only |
405 | sync --specs runs only the specs stage (lines 240-252). |
| method | TestSyncCommand.test_sync_folders_only |
419 | sync --folders runs only the folders stage. |
| method | TestSyncCommand.test_sync_with_stats |
429 | sync --stats prints the Graph Statistics block (lines 268-276). |
| method | TestSyncCommand.test_sync_all_default |
442 | No specific flag → sync_all path (line 254). |
| class | TestQueryGroupHelp |
459 | The query group itself should respond to --help. |
| method | TestQueryGroupHelp.test_query_help |
462 | query --help lists the subcommands. |
| method | TestQueryGroupHelp.test_sync_help |
470 | sync --help works. |
| class | TestDefaultRootResolution |
481 | When --root is omitted but cwd contains a context.json, find it. |
| method | TestDefaultRootResolution.test_no_root_uses_cwd_if_context_exists |
484 | If we cd into a project with context.json, the CLI auto-detects. |