Source code for openpyxl.chart.tests.test_picture

from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl

import pytest

from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml

@pytest.fixture
[docs]def PictureOptions(): from ..picture import PictureOptions return PictureOptions
[docs]class TestPictureOptions:
[docs] def test_ctor(self, PictureOptions): picture = PictureOptions() xml = tostring(picture.to_tree()) expected = """ <pictureOptions /> """ diff = compare_xml(xml, expected) assert diff is None, diff
[docs] def test_from_xml(self, PictureOptions): src = """ <pictureOptions /> """ node = fromstring(src) picture = PictureOptions.from_tree(node) assert picture == PictureOptions()