← Back to issue list

fix(tests): replace ineffective call assertions

View original Github issue

Metadata

Project
craft-parts
Number
#563
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #563 (commit 18458997) replaced ineffective assert_has_calls checks with mock_calls equality assertions in packages.deb tests, fixing #368.

Resolution: closed resolved

Reason: PR #563 was approved and merged as commit 18458997. Its test-only change normalized packages.deb mock checks and directly resolved issue #368.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Tests for the packages.deb module incorrectly use `assert_has_calls` which is ineffective in certain situations. Normalize to assert `mock_calls` instead. Fixes #368 - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #563 (commit 18458997) replaced ineffective assert_has_calls checks with mock_calls equality assertions in packages.deb tests, fixing #368.
stealth/space-bunny-alpha — closed resolved Merged PR #563 updated packages.deb tests to compare mock_calls directly instead of using ineffective assert_has_calls, fixing #368 in commit 18458997.
stealth/space-bunny-alpha — closed resolved Merged PR #563 (18458997), replacing ineffective assert_has_calls with mock_calls equality checks in packages.deb tests and resolving #368.
stealth/space-bunny-alpha — closed resolved Merged craft-parts#563 in 18458997, replacing ineffective assert_has_calls checks in packages.deb tests with direct mock_calls assertions and fixing #368.
qwen/qwen3.6-35b-a3b — — Merged to main, resolving issue #368 by replacing ineffective assert_has_calls with assert mock_calls in packages.deb module tests. Approved by two reviewers, passed CI, and rebased before final merge.
qwen3.6-35b-a3b-mtp-q6 — — Replaced ineffective assert_has_calls with mock_calls in packages.deb module tests, resolving issue #368. Merged after rebasing onto main.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#368 (confidence 100%)

    The issue identified the ineffective packages.deb test assertions fixed by PR #563.

Related issues

Issue Project State Summary Similarity
#368 The `craft_parts.packages.deb` module is incorrectly tested craft-parts closed Fixed by merged PR #563 (commit 18458997), replacing ineffective assert_has_calls checks in craft_parts.packages.deb tests with exact mock_calls assertions.
74%
#206 tests: use `assert_called_once_with` craft-providers merged Merged PR #206 as commit f73f983, updating tests to use assert_called_once_with for mock call assertions.
74%
#3025 tests: move FakeApt fixtures into deb tests snapcraft merged Merged PR #3025 in commit 1237aa6, moving FakeApt fixtures from shared test support into the DEB tests after #3024 removed the remaining external uses.
72%