set app.testing to get exceptions during test
This commit is contained in:
@@ -191,6 +191,7 @@ class TestApp:
|
|||||||
"""Test the ready route."""
|
"""Test the ready route."""
|
||||||
|
|
||||||
ProxyState.set_up(False)
|
ProxyState.set_up(False)
|
||||||
|
app.testing = True
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
response = await client.get('/-/ready')
|
response = await client.get('/-/ready')
|
||||||
assert response.status_code == 503
|
assert response.status_code == 503
|
||||||
@@ -211,6 +212,7 @@ class TestApp:
|
|||||||
|
|
||||||
with InverterBase(reader, writer, 'tsun', Talent):
|
with InverterBase(reader, writer, 'tsun', Talent):
|
||||||
ProxyState.set_up(False)
|
ProxyState.set_up(False)
|
||||||
|
app.testing = True
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
response = await client.get('/-/healthy')
|
response = await client.get('/-/healthy')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
@@ -240,6 +242,7 @@ class TestApp:
|
|||||||
|
|
||||||
with caplog.at_level(logging.INFO) and InverterBase(reader, writer, 'tsun', Talent):
|
with caplog.at_level(logging.INFO) and InverterBase(reader, writer, 'tsun', Talent):
|
||||||
ProxyState.set_up(False)
|
ProxyState.set_up(False)
|
||||||
|
app.testing = True
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
response = await client.get('/-/healthy')
|
response = await client.get('/-/healthy')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
@@ -271,6 +274,7 @@ class TestApp:
|
|||||||
|
|
||||||
with caplog.at_level(logging.INFO) and InverterBase(reader, writer, 'tsun', Talent):
|
with caplog.at_level(logging.INFO) and InverterBase(reader, writer, 'tsun', Talent):
|
||||||
ProxyState.set_up(False)
|
ProxyState.set_up(False)
|
||||||
|
app.testing = True
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
response = await client.get('/-/healthy')
|
response = await client.get('/-/healthy')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|||||||
Reference in New Issue
Block a user