Skip to content

Conversation

@jadolg
Copy link
Owner

@jadolg jadolg commented Dec 21, 2025

I wanted to make it easier to use the library and made some opinionated changes.
All methods now will trigger an exception (RocketBadStatusCodeException) if they fail that contains the failure message and status code. No more manual checking in your code. Methods will also return the json representation of the response instead of the whole requests response object. If the object can't be converted to json for any reason, the return value is the raw text.

Also on this refactor I decided to sunset some methods that we have not been able to automatically test for some time.
Those methods are:

  • settings_oauth
  • settings_addcustomoauth
  • update_jitsi_timeout

Because these are breaking changes, the next version bump will be a major one. The previous version will no longer be maintained.

- Remove some impossible to test methods
- Remove the constant usage of `.json()` to get values
- Remove the constant need to check if "success" is True
@codecov
Copy link

codecov bot commented Dec 21, 2025

Codecov Report

❌ Patch coverage is 98.54470% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.95%. Comparing base (95433ed) to head (b918e23).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
tests/conftest.py 75.00% 2 Missing and 2 partials ⚠️
rocketchat_API/APISections/base.py 94.11% 1 Missing ⚠️
tests/test_channels.py 98.93% 1 Missing ⚠️
tests/test_groups.py 98.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #329      +/-   ##
==========================================
+ Coverage   97.74%   98.95%   +1.21%     
==========================================
  Files          45       43       -2     
  Lines        2082     1912     -170     
  Branches      113      108       -5     
==========================================
- Hits         2035     1892     -143     
+ Misses         35       11      -24     
+ Partials       12        9       -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

@jadolg jadolg linked an issue Dec 21, 2025 that may be closed by this pull request
@jadolg jadolg changed the title Big refactor Stop returning requests objects Dec 21, 2025
@jadolg jadolg merged commit d71e909 into master Dec 21, 2025
44 checks passed
@jadolg jadolg deleted the big-refactor branch December 21, 2025 20:50
@jadolg jadolg linked an issue Dec 21, 2025 that may be closed by this pull request
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.

Stop returning requests objects test_settings_oauth is broken in rocket.chat 5.0

2 participants