Skip to content

test: limited test coverage for RestAPI error scenarios #210

@pankaj-bind

Description

@pankaj-bind

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions