Commit Graph

11 Commits

Author SHA1 Message Date
Jordan Eremieff f4fe0ec312 Name changes (#55)
* Rename View -> HTTPEndpoint

* Rename views doc file -> endpoints

* Rename request/response files -> requests/responses, update imports, update docs

* Rename WebSocketSession -> WebSocket, rename session -> websocket in docs

* Full module imports in tests and source, removing imports from __init__ file

* Fix name in testclient doc
2018-09-05 10:29:04 +01:00
Tom Christie 67d95fcfa7
Exception handling (#54)
* Exception handling

* Black formatting

* Add exception handling to App

* Handle cases where exception raised but response already started

* Order exception handler lookup by class inheritance

* Handle 404/405 as responses without App, or exceptions with it.

* Only use TestClient(app, raise_exceptions=False) explicitly inside test cases

* Documentation for ExceptionMiddleware

* Drop error_handler/exception_handler distinction.

* Finesse and document TestClient(app, raise_server_exceptions=False)

* Refactoring to make debug responses easier to obtain from elsewhere in code

* Use named status_code argument in example

* Clean up raise_server_errors usage in tests

* Consistent title-casing in HTTP reason phrases

* Black formatting

* Add WebSocketClose close. Omit message-body on 204, 304 exception cases.

* Black formatting

* Add 'debug' flag to App and ExceptionMiddleware

* Support app.debug

* Document debug mode

* Documenting debug
2018-09-04 11:52:29 +01:00
Tom Christie 8245768f81
Use 405 for Method Not Allowed (#53) 2018-08-30 14:42:39 +01:00
Tom Christie 2519f83765 client.wsconnect -> client.websocket_connect 2018-08-28 14:45:06 +01:00
Tom Christie 00a972c719
Add App class (#42)
* Add App class

* Black formatting

* Support kwargs in App routes

* Black formatting

* Use protocol based routing in app

* WebSocket close when no route found

* session.send(...), session.receive(...) for test client

* Support app.mount(prefix, app)

* Black formatting

* Black formatting

* Minor tweaks to websocket test client

* Add 'App' to README
2018-08-28 14:34:18 +01:00
Tom Christie 6f948e95b4
WebSockets support (#37)
* WebSockets support

* WebSockets support

* WebSockets support

* Black formatting

* Add missing descriptions against websocket test session docs

* Add missing descriptions against websocket test session docs

* Add note on session.send() / session.receive()
2018-08-17 16:36:48 +01:00
Tom Christie 43ed532728 Tweak imports and docs 2018-07-12 14:09:05 +01:00
Tom Christie b5a8d614f4 Black formatting 2018-06-26 10:09:59 +01:00
Tom Christie 4f80753cf7 Version 0.1.3 2018-06-26 10:09:35 +01:00
Tom Christie 2a4955f993 Black 2018-06-25 22:26:01 +01:00
Tom Christie 903e1b2fc5 Add Router, Path, PathPrefix 2018-06-25 22:23:40 +01:00