test: raise fastapi_startkit coverage to >=80% and enforce threshold#193
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Raises actual test coverage of
fastapi_startkitfrom 79.87% → 80.93% and bumps the coverage gate (fail_under) from 68 → 80 inpyproject.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_setnot mutating empty dicts,Column.defaultattribute shadowing its method,load()raisingAttributeErrorrather than returning the default).Modules gaining coverage
masoniteorm/expressions/expressions.pysupport/string.pyutils/structures.pystorage/drivers/local.pymasoniteorm/schema/Column.pyTotal: 79.87% → 80.93% (
fail_under68 → 80).Tests added
tests/masoniteorm/query/test_expressions.py— expression helpers: select/order-by alias & direction parsing, joinONclause construction, operator validationtests/support/test_string.py—Str/Stringableslugify/trim/camel/snake helpers and fluent chainingtests/utils/test_structures.py—data/data_get/data_setdotted access + wildcards, and the moduleload()helpertests/masoniteorm/schema/test_column.py— fluent column builder methodstests/storage/test_local_driver.py— extended forput_file,store,stream, path resolution, and directory-skippingVerification
uv run pytest --cov --ignore=tests/masoniteorm/postgres→ 1920 passed, 7 skipped,Required test coverage of 80.0% reached. Total coverage: 80.93%.