mirror of https://github.com/encode/starlette.git
Merge branch 'master' of https://github.com/encode/starlette
This commit is contained in:
commit
291255b24c
|
@ -43,25 +43,6 @@ app = ExceptionMiddleware(router)
|
||||||
client = TestClient(app)
|
client = TestClient(app)
|
||||||
|
|
||||||
|
|
||||||
# def test_server_error():
|
|
||||||
# with pytest.raises(RuntimeError):
|
|
||||||
# response = client.get("/runtime_error")
|
|
||||||
#
|
|
||||||
# allow_500_client = TestClient(app, raise_server_exceptions=False)
|
|
||||||
# response = allow_500_client.get("/runtime_error")
|
|
||||||
# assert response.status_code == 500
|
|
||||||
# assert response.text == "Internal Server Error"
|
|
||||||
|
|
||||||
|
|
||||||
# def test_debug_enabled():
|
|
||||||
# app = ExceptionMiddleware(router)
|
|
||||||
# app.debug = True
|
|
||||||
# allow_500_client = TestClient(app, raise_server_exceptions=False)
|
|
||||||
# response = allow_500_client.get("/runtime_error")
|
|
||||||
# assert response.status_code == 500
|
|
||||||
# assert "RuntimeError" in response.text
|
|
||||||
|
|
||||||
|
|
||||||
def test_not_acceptable():
|
def test_not_acceptable():
|
||||||
response = client.get("/not_acceptable")
|
response = client.get("/not_acceptable")
|
||||||
assert response.status_code == 406
|
assert response.status_code == 406
|
||||||
|
|
Loading…
Reference in New Issue