Skip to content

Testing API Interactions #1040

Open
Open
@alexreisner

Description

@alexreisner

Currently the test suite stubs HTTP requests in a somewhat unsophisticated way, implementing proprietary logic about raising errors and returning data. This works pretty well (and is relatively easy to understand) but has a few shortcomings:

  • doesn't test specific aspects of the HTTP/HTTPS connection (see, eg, Disable SSL v2 and v3 if ssl enabled #1035)
  • doesn't test authentication (either HTTP Basic or with API keys)
  • doesn't test code inside of make_api_request (because it's stubbed)
  • defines response content and headers in different places (content is in a file, status code and headers are defined in a method)

I'm open to discussion about how to improve the above. However, note that any solution must:

  • be able to simulate requests to APIs that require authentication, without storing credentials in the Git repo (ie: everyone needs to be able to run these tests)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions