Skip to content

User application testing facility #423

@saaj

Description

@saaj

Does aiohttp provide functionality to test application written with its HTTP client? It is in the sense of packages like httpretty, responses and this SO question. Basically it may be some mock connector to say here's the next response your should return on any request. Or it may be more elaborate with separate queues for HTTP methods, base URLs, et cetera. It's useful for integration and system testing. Workarounds are possible, but require to construct complete server to imitate the target and to patch the application's URLs, which can take some substantial effort.

Even though it's not in my direct interest, the same thing may also apply to HTTP server. Some sort of base test case class that provides means to start user's app, do requests and make assertions about them with ease. Here is how CherryPy does it.

I've looked at the test suite and aiohttp.test_utils but there seems to be nothing what I'm looking for exactly. If I have not overlooked it and there's no such functionality at the moment, this can be treated as a feature request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions