Repository navigation
Conversation
Mechanical formatting only, so later diffs (and the PostToolUse format hook) don't mix whitespace churn into behavior changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/helpers.py: isolated_env()/scrubbed_environ() strip SKIP_RATIO_CHECK, CLEANUP_*, TRANSMISSION_* and FETCH_TORRENTS_* (except the log dir), and make_temp_dir() removes its dir on cleanup. - test_fetch_torrents applies isolated_env() module-wide, so an exported SKIP_RATIO_CHECK=true no longer fails 9 ratio-gate tests. - The stagnation watch-file test pins ft.date instead of using date.today(). - The unsafe-name watch-file test asserts on disk instead of patching the process-wide os.remove (which log rotation also calls). - Every mkdtemp/mkstemp in tests is now removed after the test. - CI runs the suite a second time with a hostile environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ShouldFetchTorrentBoundaryTests: ratio exactly 1.0 vs 0.999 (standard and Devuan), only-newer / same-version-only records, highest older version deciding, other-arch isolation, Devuan ignoring non-Devuan and same-release entries, live-over-removed priority both ways, SKIP_RATIO_CHECK, unknown distro and unparseable names. Every ShouldFetchTorrent* class now pins SKIP_RATIO_CHECK=false in setUp. Hand-applied mutants listed in the task are all killed; the one survivor (dropping 'n in ratios or' in the removed-history loop) is equivalent, since setdefault() already keeps the live ratio. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers missing file, no markers, last-segment-wins, START without END, END before the last START, name stripping, integer ratios not matching, and duplicate names. get_previous_ratios is now fully covered by the normal unittest run; the subprocess restart test stays as-is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bdecode silently accepted a byte string whose declared length ran past the end of the data (b'4:ab' -> b'ab'), so a truncated .torrent decoded into a wrong info dict and hash. Missing 'e'/':' terminators and non-numeric integers/lengths leaked bare ValueErrors from bytes.index() and int(); int() also accepted '1_0' and whitespace. All of these now raise BencodeError naming the problem and its index. BencodeError still subclasses ValueError, so existing callers are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full mutmut 2.5.1 re-run after tasks 10-13 left four killable survivors in the touched functions: - should_fetch_torrent: 'continue' -> 'break' and 'or' -> 'and' in the removed-history skip (a skipped legacy entry first, and no parse-error warning for entries without a ratio). - bdecode: '>=' -> '>' on the end-of-data guard and the remaining-bytes arithmetic in the truncation message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old loop kept an end_index that was reset on every START, which made the 'end_index > start_index' check and the initial 'end_index = None' redundant - mutmut reported both as surviving (equivalent) mutants. Selecting 'after the last START, up to the last END after it' directly removes them. A new test pins the existing 'last END wins' behavior before the rewrite; mutmut now kills 28/28 mutants in the function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
No description provided.