mindsdb / mindsdb/mindsdb_python_sdk
test: limited test coverage for RestAPI error scenarios
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44
- Forks
- 16
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 1
Description
The test suite in tests/test_sdk.py has limited coverage for RestAPI error scenarios, such as handling 404 Not Found or 500 Internal Server Error responses.
This is because the function responsible for raising HTTP errors is globally mocked, preventing any tests for failure conditions. This can lead to unpredictable behavior in the SDK when it encounters real-world API errors, impacting its robustness and reliability.
The specific line in tests/test_sdk.py that disables error checking is:
# patch _raise_for_status
rest_api._raise_for_status = Mock()
I have developed a solution for this issue. If allowed, I would like to raise a pull request to add proper test coverage for these error cases.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read tests/test_sdk.py and locate the mocked rest_api._raise_for_status assignment. Run the existing SDK tests first, then add coverage for 404 Not Found and 500 Internal Server Error responses without globally disabling error checking. Done means the failure scenarios are exercised and the test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, testing-qa
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100