Skip to content

test: raise fastapi_startkit coverage to >=80% and enforce threshold#193

Merged
tmgbedu merged 1 commit into
mainfrom
task/coverage-80-1214
Jul 23, 2026
Merged

test: raise fastapi_startkit coverage to >=80% and enforce threshold#193
tmgbedu merged 1 commit into
mainfrom
task/coverage-80-1214

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Raises actual test coverage of fastapi_startkit from 79.87% → 80.93% and bumps the coverage gate (fail_under) from 68 → 80 in pyproject.toml, now that real coverage supports it.

These are genuine behavior tests with real assertions (alias parsing, direction inference, file I/O against tmp_path, dotted-key access), not mock-only padding — several tests actually surfaced real quirks in the source (e.g. data_set not mutating empty dicts, Column.default attribute shadowing its method, load() raising AttributeError rather than returning the default).

Modules gaining coverage

Module Before After
masoniteorm/expressions/expressions.py 67% ~100%
support/string.py 82% 100%
utils/structures.py 23% ~96%
storage/drivers/local.py 77% ~96%
masoniteorm/schema/Column.py 72% 100%

Total: 79.87% → 80.93% (fail_under 68 → 80).

Tests added

  • tests/masoniteorm/query/test_expressions.py — expression helpers: select/order-by alias & direction parsing, join ON clause construction, operator validation
  • tests/support/test_string.pyStr/Stringable slugify/trim/camel/snake helpers and fluent chaining
  • tests/utils/test_structures.pydata/data_get/data_set dotted access + wildcards, and the module load() helper
  • tests/masoniteorm/schema/test_column.py — fluent column builder methods
  • tests/storage/test_local_driver.py — extended for put_file, store, stream, path resolution, and directory-skipping

Verification

uv run pytest --cov --ignore=tests/masoniteorm/postgres1920 passed, 7 skipped, Required test coverage of 80.0% reached. Total coverage: 80.93%.

Add real unit tests for previously under-covered pure-logic modules and
raise the coverage gate from 68 to 80 now that actual coverage supports it.

Modules gaining coverage:
- masoniteorm/expressions/expressions.py (67% -> ~100%): alias splitting,
  order-by direction inference, join ON-clause construction, operator validation
- support/string.py (82% -> 100%): Str/Stringable slug/trim/camel/snake helpers
- utils/structures.py (23% -> ~96%): dotty data get/set, wildcard, module loader
- storage/drivers/local.py (77% -> ~96%): put_file, store, stream, path resolution
- masoniteorm/schema/Column.py (72% -> 100%): fluent column builder methods

Total coverage 79.87% -> 80.93%; fail_under 68 -> 80.
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tmgbedu
tmgbedu merged commit 124bde6 into main Jul 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant