Skip to content

Conversation

@jpstroop
Copy link
Owner

@jpstroop jpstroop commented Mar 5, 2025

No description provided.

@codecov
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (642d7f2) to head (ec6f088).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #13   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        33    +1     
  Lines         1665      1692   +27     
  Branches       129       130    +1     
=========================================
+ Hits          1665      1692   +27     
Files with missing lines Coverage Δ
fitbit_client/exceptions.py 100.00% <100.00%> (ø)
fitbit_client/resources/activity.py 100.00% <100.00%> (ø)
fitbit_client/resources/base.py 100.00% <100.00%> (ø)
fitbit_client/resources/body.py 100.00% <100.00%> (ø)
fitbit_client/resources/electrocardiogram.py 100.00% <100.00%> (ø)
fitbit_client/resources/heartrate_timeseries.py 100.00% <100.00%> (ø)
...client/resources/irregular_rhythm_notifications.py 100.00% <100.00%> (ø)
fitbit_client/resources/nutrition.py 100.00% <100.00%> (ø)
fitbit_client/resources/sleep.py 100.00% <100.00%> (ø)
fitbit_client/resources/user.py 100.00% <100.00%> (ø)
... and 2 more

Extract curl command generation functionality from BaseResource to a dedicated mixin in utils/curl_debug_mixin.py. This improves code organization by:

1. Moving a single-purpose feature into its own module
2. Simplifying the BaseResource class
3. Making the debug functionality more reusable

Also updated tests to maintain 100% coverage.

Improve type safety with specialized dictionary types

Replace generic Optional[Dict[str, Any]] with specialized type aliases throughout the codebase:
1. ParamDict for query string parameters
2. FormDataDict for form data parameters
3. JSONDict for JSON data structures

These changes provide better static type checking, improve code readability and maintainability,
and fix all mypy type errors related to dictionary types.

Add test for curl debug mixin without OAuth

Added test case for the fallback path in CurlDebugMixin when OAuth token is not available,
ensuring 100% test coverage for the mixin class.

Standardize _make_request call formatting

- Make endpoint the only positional argument
- Use keyword arguments for all other parameters
- Adopt consistent multi-line formatting
- Maintain 100% test coverage

This change improves code readability and maintainability by ensuring a consistent approach to API calls throughout the codebase.

Add *,cover files to .gitignore

These files are coverage artifacts that should not be tracked in the repo.
@jpstroop jpstroop merged commit 5ecc6e1 into main Mar 5, 2025
8 checks passed
@jpstroop jpstroop deleted the calories branch March 5, 2025 04:40
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.

2 participants