comparison env/lib/python3.7/site-packages/prov/tests/test_dot.py @ 2:6af9afd405e9 draft

"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author shellac
date Thu, 14 May 2020 14:56:58 -0400
parents 26e78fe6e8c4
children
comparison
equal deleted inserted replaced
1:75ca89e9b81c 2:6af9afd405e9
1 """
2 Created on Aug 13, 2015
3
4 @author: Trung Dong Huynh
5 """
6 from __future__ import (absolute_import, division, print_function,
7 unicode_literals)
8
9 import unittest
10
11 # Skipping SVG tests if pydot is not installed
12 from pkgutil import find_loader
13 if find_loader("pydot") is not None:
14
15 from prov.dot import prov_to_dot
16 from prov.tests.test_model import AllTestsBase
17 from prov.tests.utility import DocumentBaseTestCase
18
19
20 class SVGDotOutputTest(DocumentBaseTestCase, AllTestsBase):
21 """
22 One-way output SVG with prov.dot to exercise its code
23 """
24 MIN_SVG_SIZE = 850
25
26 def do_tests(self, prov_doc, msg=None):
27 dot = prov_to_dot(prov_doc)
28 svg_content = dot.create(format="svg")
29 # Very naive check of the returned SVG content as we have no way to check the graphical content
30 self.assertGreater(
31 len(svg_content), self.MIN_SVG_SIZE,
32 "The size of the generated SVG content should be greater than %d bytes" % self.MIN_SVG_SIZE
33 )
34
35
36 if __name__ == '__main__':
37 unittest.main()