handle graphviz parsing errors more cleanly

This commit is contained in:
2021-06-24 11:37:57 -05:00
parent 41a53a2a13
commit e61c55bed2
4 changed files with 30 additions and 0 deletions

View File

@@ -27,3 +27,13 @@ def test_graphviz_is_rendered():
assert response.status_code == 200
assert b'~~~pydot' not in response.data
assert b'data:image/png;base64' in response.data
def test_invalid_graphviz_is_not_rendered():
"""Check that invalid graphviz doesn't blow things up."""
app = app_with_pydot()
client = app.test_client()
response = client.get('/test-invalid-graphviz')
assert response.status_code == 500
assert b'INTERNAL SERVER ERROR' in response.data