test: limited test coverage for RestAPI error scenarios
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, testing-qa
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.
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.
- Dominant language
- Python
- Stars
- 44
- Forks
- 16
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 1
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.
More from mindsdb/mindsdb_python_sdk
-
NotImplementedError Open
Difficulty 4/5 3-5 days Newbie friendliness 15/100
mindsdb/mindsdb_python_sdk#203 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
mindsdb/mindsdb_python_sdk#201 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
mindsdb/mindsdb_python_sdk#190 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mindsdb/mindsdb_python_sdk#186 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mindsdb/mindsdb_python_sdk#184 · 1 comment ·
All issues in mindsdb/mindsdb_python_sdk
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100