Пример #1
0
    def test_svg(self):
        """ should properly insert arbitrary svg string """

        source = '<svg><circle r="1" cx="1" cy="1"></circle></svg>'

        dom = render.svg(source)
        self.assertGreater(dom.find(source), 0)
Пример #2
0
def svg(svg_dom: str, filename: str = None):
    """
    Adds the specified SVG string to the display. If a filename is
    included, the SVG data will also be saved to that filename within the
    project results folder.

    :param svg_dom:
        The SVG string data to add to the display.
    :param filename:
        An optional filename where the SVG data should be saved within
        the project results folder.
    """
    r = _get_report()
    r.append_body(render.svg(svg_dom))
    r.stdout_interceptor.write_source('[ADDED] SVG\n')

    if not filename:
        return

    if not filename.endswith('.svg'):
        filename += '.svg'

    r.files[filename] = svg_dom
Пример #3
0
def svg(svg_dom: str, filename: str = None):
    """
    Adds the specified SVG string to the display. If a filename is
    included, the SVG data will also be saved to that filename within the
    project results folder.

    :param svg_dom:
        The SVG string data to add to the display
    :param filename:
        An optional filename where the SVG data should be saved within
        the project results folder
    """

    r = _get_report()
    r.append_body(render.svg(svg_dom))

    if not filename:
        return

    if not filename.endswith('.svg'):
        filename += '.svg'

    r.files[filename] = svg_dom
Пример #4
0
    def test_svg(self):
        """Should properly insert arbitrary svg string"""

        source = '<svg><circle r="1" cx="1" cy="1"></circle></svg>'
        dom = render.svg(source)
        self.assertGreater(dom.find(source), 0)