comparison env/lib/python3.7/site-packages/prov/tests/test_dot.py @ 5:9b1c78e6ba9c draft default tip

"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author shellac
date Mon, 01 Jun 2020 08:59:25 -0400
parents 79f47841a781
children
comparison
equal deleted inserted replaced
4:79f47841a781 5:9b1c78e6ba9c
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()