Improve test coverage across pure-Python models and Config#15
Open
blindndangerous wants to merge 16 commits intomasonasons:masterfrom
Open
Improve test coverage across pure-Python models and Config#15blindndangerous wants to merge 16 commits intomasonasons:masterfrom
blindndangerous wants to merge 16 commits intomasonasons:masterfrom
Conversation
Covers MutableMapping contract, get/set/del, attribute access, the dict-wrapping side-effect (stored dicts become Config objects, not plain dicts), close() idempotency, and child-to-parent save delegation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers from_github_api field mapping, missing-field defaults, get_display_name for files and directories, and get_size_str for all size buckets (bytes, KB, MB). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers from_api field mapping, datetime parsing (valid/invalid/absent), all known reason display strings, type icons, format_display read/unread states, get_web_url API-to-web URL conversion, and all relative time buckets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers get_action_description for all event types (WatchEvent, ForkEvent, CreateEvent, DeleteEvent, PushEvent, Discussion*, Issues*, IssueComment*, PullRequest*, PullRequestReview*, Release, CommitComment, Gollum, Member, Public, and unknown fallback), format_display, get_web_url for every event-type branch, get_actor_url, and _format_relative_time buckets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers from_github_api field mapping for all three models, format_display active/inactive states, get_status_icon for all status/conclusion combinations, get_status_text, WorkflowJob duration formatting, and _format_relative_time buckets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds full coverage for WorkflowJob.from_github_api, get_status_icon, get_duration (seconds/minutes/hours/no-end), and format_display. Also covers the invalid-datetime exception paths in Workflow and WorkflowRun that were previously uncovered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds parametrized tests for every IssuesEvent and PullRequestEvent action variant when the issue/PR title is absent, ensuring the title-less string format is correct. Adds PullRequestReviewEvent no-title variants and the DiscussionCommentEvent reply_to_id field (alternate reply detection field used by some API payloads). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the four specific missing paths: IssuesEvent labeled-with-title, IssueCommentEvent deleted-without-title, PullRequestEvent generic-action- without-title, and review_requested-with-title-but-no-reviewer. Only the unreachable format_display exception handler remains uncovered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers from_github_api field mapping, datetime parsing, labels/assignees lists, is_pull_request detection, format_display for all states (open/closed/merged/draft), and _format_relative_time with singular and plural forms for all time buckets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers from_github_api field mapping, format_size for all buckets including GB, format_display download count singular/plural, get_status_label combinations, _format_relative_time including weeks and date fallback, format_display name-vs-tag branching, and asset list parsing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Repository: from_github_api field mapping, format_display with/without description and truncation, format_single_line, _format_relative_time singular/plural for all buckets. UserProfile: from_github_api field mapping, display_name fallback to login, format_display with/without name and bio, bio truncation at 50 chars, newline replacement, _format_relative_time singular/plural. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
conftest.py adds the project root to sys.path so top-level modules (config, repo_sync, etc.) are importable from the tests/ subdirectory. pytest.ini sets --basetemp=.pytest_tmp to avoid Windows temp-dir permission errors when using the tmp_path fixture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 tests covering: _load() reads/misses/invalid JSON, save() creates files and subdirs, roundtrips, autosave on setitem/delitem, close(), config_file path in portable and non-portable modes, is_portable_mode() detection and caching, get_config_home() platform dispatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mocked 36 tests covering: _ensure_defaults, get/set_repo_config, get_enabled_repos, sync_all_enabled (global disable + per-repo dispatch), sync_one (error paths for missing/non-git path, success with fetch+pull), _run_git (success/failure), _run_git_allow_fail, _maybe_push (dirty/detached/not-ahead/ahead/no-upstream), _run_lfs_sync (disabled/missing/happy-path), RepoSyncResult dataclass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… HTTP 40 tests: username/display_name properties, last error management, get_repos (pagination, error, empty page), get_repo, get_issues (PR filtering, pagination), get/create/update/close/reopen issue, issue comments (get/create/delete), _graphql (success, HTTP error, GraphQL errors, None data, exception). Uses object.__new__ to bypass wx-dependent __init__. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 tests: verify all major modules import cleanly (models, config, repo_sync, github_api), expose expected class/method names, constants are correct types, and core classes instantiate from minimal data without crashing. wx is stubbed so github_api can be imported without a running GUI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 354 new tests across 5 new test files, bringing key modules from 0% to near-complete coverage without requiring a running wx app.
models/content.pymodels/workflow.pymodels/event.pymodels/notification.pyconfig.pyThe 69% on
config.pyand 95% onnotification.pyrepresent file I/O paths andexcept Exceptionhandlers that can't be triggered without deliberately corrupting objects — those are correct to leave uncovered.New test files
tests/test_config.py— Config MutableMapping contract, get/set/del, attribute routing, dict-wrapping behaviour (the bug that caused a real production issue), close() idempotency, child→parent save delegationtests/test_models_content.py— ContentItem parsing,get_display_name,get_size_strfor all size bucketstests/test_models_notification.py— Notification/NotificationSubject parsing, all 12 reason display strings, type icons, format_display, get_web_url, relative time bucketstests/test_event_descriptions.py— Every branch ofget_action_description(all event types, all action sub-types, with and without titles),format_display,get_web_urlfor every event type,get_actor_url, relative time bucketstests/test_models_workflow.py— Workflow, WorkflowRun, WorkflowJob parsing, all status/conclusion icon combinations, duration formatting, relative timetests/test_config_io.py— Config file I/O, save/load roundtrips, portable mode detection, platform path dispatchtests/test_repo_sync_mocked.py— RepoSyncManager with subprocess mocked: defaults, get/set config, sync_one error/success paths, push logic, LFS synctests/test_github_api_mocked.py— GitHubAccount API methods with requests.Session mocked: repos, issues, comments, CRUD, GraphQLtests/test_smoke.py— All major modules import cleanly, constants correct, core classes instantiate without crashingTest plan
pytest tests/→ 706 passed, 0 failed🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 <claude[bot]@users.noreply.github.com>