Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: Fake Twilio Client #821

Open
@qdii

Description

@qdii

Issue Summary

Properly testing client code against Twilio python library isn't easy. None of the solutions I have found so far allow to run tests with good coverage that are reproducible and hermetic:

  • Thisblog post suggests mocking the entire client, but this methodology fails to catch problems such as callingclient.messages.send() with invalid parameters or function names.
  • Thisfeature request suggests to uselocalhost instead ofapi.twilio.com, but this means reverse-engineering the protocol used to talk to api.twilio.com and maintaining a server running just for tests.
  • The option to useresponses python package to mock POST and GET requests to api.twilio.com is also very brittle, as the tests would break every time the client is changed. It also takes reverse engineering to know what the client expects.
  • Usingtest credentials is a bad idea: first because this means the tests are not hermetic and reproducible, then because it hammers Twilio API endpoint every time a test is run, and last because it makes the test flaky by adding a dependency on internet connectivity and the endpoint being online.

To solve that, could you please provide a library that allows users to test the integration with the Client instance?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp