Skip to content

Increase Test Coverage for PyLoadAPI#33

Merged
tr4nt0r merged 1 commit intomainfrom
test_coverage
Jun 16, 2024
Merged

Increase Test Coverage for PyLoadAPI#33
tr4nt0r merged 1 commit intomainfrom
test_coverage

Conversation

@tr4nt0r
Copy link
Owner

@tr4nt0r tr4nt0r commented Jun 16, 2024

Enhanced the testing framework to improve coverage for PyLoadAPI:

  • Added new fixture TEST_STATUS_RESPONSE to mock status responses.
  • Updated imports to use collections.abc for AsyncGenerator and Generator.
  • Added parameterized tests in test_api.py to cover various API methods including version, get_status, pause, unpause, toggle_pause, stop_all_downloads, restart_failed, toggle_reconnect, delete_finished, restart, and free_space.
  • Implemented a test to validate the LoginResponse dataclass methods from_dict, to_dict and __getitem__.

Enhanced the testing framework to improve coverage for PyLoadAPI:

- Added new fixture `TEST_STATUS_RESPONSE` to mock status responses.
- Updated imports to use `collections.abc` for `AsyncGenerator` and `Generator`.
- Added parameterized tests in `test_api.py` to cover various API methods including `version`, `get_status`, `pause`, `unpause`, `toggle_pause`, `stop_all_downloads`, `restart_failed`, `toggle_reconnect`, `delete_finished`, `restart`, and `free_space`.
- Implemented a test to validate the `LoginResponse` dataclass methods `from_dict`, `to_dict` and `__getitem__`.
@codecov
Copy link

codecov bot commented Jun 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0f6d906) to head (c8bd8c2).

Additional details and impacted files
@@             Coverage Diff             @@
##             main       #33      +/-   ##
===========================================
+ Coverage   96.83%   100.00%   +3.16%     
===========================================
  Files           4         4              
  Lines         158       158              
===========================================
+ Hits          153       158       +5     
+ Misses          5         0       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tr4nt0r tr4nt0r merged commit 1fdd341 into main Jun 16, 2024
@tr4nt0r tr4nt0r deleted the test_coverage branch June 16, 2024 00:55
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