def test_rotation_4(self): """Check that graphic is rotated properly.""" graphic = Graphic(etree.parse("arrow.svg").getroot()) xml = graphic.get_xml() graphic.set_rotation(23.21) graphic.set_rotation(0) assert graphic.get_xml() == xml
def test_rotation_3(self): """Check that graphic is rotated properly.""" graphic = Graphic(etree.parse("arrow.svg").getroot()) pos = graphic.get_position() graphic.set_rotation(23.21) f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w") f.write(graphic.get_xml()) f.close() assert graphic.get_position() == pos
def test_changed_flag(self): """Check that changed flag works correctly.""" graphic = Graphic(etree.parse("arrow.svg").getroot()) graphic.reset_changed_flag() graphic.set_mirror_x(True) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_mirror_x(False) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_scale(2) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_rotation(2) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_position(2, 500) assert not graphic.get_changed_flag(), "Changed flag should not be set!" graphic.reset_changed_flag() graphic.set_weedline(True) assert graphic.get_changed_flag(), "Changed flag should be set!"
def test_changed_flag(self): """Check that changed flag works correctly.""" graphic = Graphic(etree.parse("arrow.svg").getroot()) graphic.reset_changed_flag() graphic.set_mirror_x(True) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_mirror_x(False) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_scale(2) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_rotation(2) assert graphic.get_changed_flag(), "Changed flag should be set!" graphic.reset_changed_flag() graphic.set_position(2, 500) assert not graphic.get_changed_flag( ), "Changed flag should not be set!" graphic.reset_changed_flag() graphic.set_weedline(True) assert graphic.get_changed_flag(), "Changed flag should be set!"
def test_rotation_1(self): """Check that graphic is rotated properly.""" graphic = Graphic(etree.parse("arrow.svg").getroot()) h = graphic.get_height() graphic.set_rotation(90) assert graphic.get_width() == h