summaryrefslogtreecommitdiff
path: root/tests/test_pretty_print.py
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-03-11 23:29:45 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-03-11 23:29:45 (GMT)
commit40cd64042aec8a452283d60cbb676b9242d9a346 (patch)
treefb23c498afc75c03df8f97f7c2eda466d1168c30 /tests/test_pretty_print.py
parent79ce1e47d0ff250aed46ddc3058ea4f694900bb0 (diff)
parentd9c4b779421b226d0ad1eed492611eb5ddb843ed (diff)
Merge branch 'master' of github.com:openscad/openscad into resize5
Diffstat (limited to 'tests/test_pretty_print.py')
-rwxr-xr-xtests/test_pretty_print.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index 54b0f92..3f4f1c9 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -312,14 +312,21 @@ TESTLOG
def png_encode64( fname, width=250 ):
# en.wikipedia.org/wiki/Data_URI_scheme
- f = open( fname, "rb" )
- data = f.read()
+ try:
+ f = open( fname, "rb" )
+ data = f.read()
+ except:
+ data = ''
data_uri = data.encode("base64").replace("\n","")
tag = '<img'
+ tag += ' style="border:1px solid gray"'
tag += ' src="data:image/png;base64,'
tag += data_uri + '"'
tag += ' width="'+str(width)+'"'
- tag += ' alt="openscad_test_image"'
+ if data =='':
+ tag += ' alt="error: no image generated"'
+ else:
+ tag += ' alt="openscad_test_image"'
tag += ' />\n'
return tag
contact: Jan Huwald // Impressum