Skip to content

Add a MockedApiClient and/or MockedApiClientFactory classes #153

@Andy-Grigg

Description

@Andy-Grigg

It's going to be quite a common occurrence for packages that depend on openapi-common to want to mock connections to test with canned responses. Instead of forcing every dependent package to write their own boilerplate code to do this, it would be nice to add this as functionality to this library.

For example, expose something like:

from ansys.openapi.common import testing

cxn = testing.ApiClientFactory('http://localhost").connect()
cxn.register_response(my_canned_response)
result = cxn.run(query)  # Returns my_canned_response

I'm not suggesting that as the actual interface, there's probably a lot more complexity that's required. But something like that would help mocking out connections to remote resources for package authors.

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