diff options
author | Marius Kintel <marius@kintel.net> | 2013-03-09 16:05:29 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-03-09 16:05:29 (GMT) |
commit | e868b4a5a178ceb6b340e16151b0f82ec322fc9a (patch) | |
tree | 49ed68a853999c832265b4dda856107b59f2dd5b /tests/test_pretty_print.py | |
parent | b308ec270d69ef2981b4c89a55f3549aecc9b603 (diff) | |
parent | a7ee238a51fbf0dc6b24b2cbfec0a3f82407175c (diff) |
Merge pull request #299 from openscad/testdriver-fix
Testdriver fix
Diffstat (limited to 'tests/test_pretty_print.py')
-rwxr-xr-x | tests/test_pretty_print.py | 13 |
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 |