pydot: handle multiple dot images in one file

This commit is contained in:
2022-04-18 14:40:01 -05:00
parent 9a65dfffaf
commit 08305e26db
4 changed files with 48 additions and 5 deletions

View File

@@ -29,6 +29,17 @@ def test_graphviz_is_rendered():
assert b'data:image/png;base64' in response.data
def test_two_graphviz_are_rendered():
"""Test two images are rendered."""
app = app_with_pydot()
client = app.test_client()
response = client.get('/test-two-graphviz')
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()

View File

@@ -15,6 +15,10 @@ LOGGING = {
},
},
'loggers': {
'incorporealcms.mdx': {
'level': 'DEBUG',
'handlers': ['console'],
},
'incorporealcms.pages': {
'level': 'DEBUG',
'handlers': ['console'],

View File

@@ -0,0 +1,25 @@
# test
test
~~~pydot:attack-plan
digraph G {
rankdir=LR
Earth
Mars
Earth -> Mars
}
~~~
more test
~~~pydot:new-attack-plan
digraph H {
rankdir=LR
Venus
Mars
Venus -> Mars
}
~~~
done