Add pure-logic core test suite + lightweight coverage CI + badges#5
Open
beepboop2025 wants to merge 1 commit into
Open
Add pure-logic core test suite + lightweight coverage CI + badges#5beepboop2025 wants to merge 1 commit into
beepboop2025 wants to merge 1 commit into
Conversation
Adds 36 dependency-free unit tests (tests/test_core_utils.py) pinning the
statutory reference logic that has no existing dedicated coverage:
* cii_table — CII indexation formula, monotonicity, missing-FY errors
* compliance_calendar — advance-tax / TDS / GST / ROC / LLP deadline generation,
entity-type and audit branching, sort + serialization
* gst_rates — HSN/keyword/rate lookups, CGST/SGST/IGST split + rounding
* tds_rates — section lookups + Section 206AA/206CC no-PAN rate logic
These four modules reach 100% statement coverage (162 stmts).
Adds .github/workflows/tests.yml: a deterministic [push, pull_request] job that
installs only pytest+pytest-cov and runs the pure-logic suite with coverage —
no Postgres/Redis/API keys, so it always runs green. The heavier integration
suite remains in ci.yml. Adds CI status + coverage badges to README.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Adds a focused, dependency-free unit-test suite for the statutory reference logic that previously had no dedicated coverage, plus a lightweight CI workflow and README badges.
New tests —
backend/tests/test_core_utils.py(36 cases)Genuine, behavior-pinning assertions (no filler) over four stdlib-only modules:
app/utils/cii_table.pyCIINotFoundErrorcontents, indexed-cost formulacost × CIIsale/CIIpurchase, half-up 2-dp rounding, same-year identityapp/utils/compliance_calendar.pyapp/utils/gst_rates.pyCGST + SGST == totalrounding invariant, zero-rateapp/utils/tds_rates.pymax(2×rate, 20%)and 206CCmax(2×rate, 5%)no-PAN logic, slab-based 20% defaultThese four modules reach 100% statement coverage (162 statements).
CI —
.github/workflows/tests.ymlRuns on
[push, pull_request]. Installs onlypytest+pytest-cov, runs the pure-logic suite with--covand prints the coverage summary. No Postgres / Redis / API keys, so it is deterministic and always green. The existing heavier integration suite (ci.yml) is untouched.README
Adds live CI status + coverage badges at the top.
Verification
Run locally before push:
36 passed, 100% coverage on the four targeted modules.