Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 def test_mirror_y(self):
     """Check that graphic is mirrored properly about the y axis."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     graphic.set_mirror_y(True)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
Пример #4
0
 def test_mirror_y(self):
     """Check that graphic is mirrored properly about the y axis."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     graphic.set_mirror_y(True)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
Пример #5
0
 def test_translate_2(self):
     """Check that graphic is translated properly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     graphic.set_position(500, 237.21)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
     assert map(lambda x: round(x, 10), graphic.get_position()) == [500, 237.21], "Position should be 500,237.21!"
Пример #6
0
 def test_weedline(self):
     """Check a weedline is added correctly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     pos = graphic.get_position()
     graphic.set_weedline(True)
     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
Пример #7
0
 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
Пример #8
0
 def test_weedline(self):
     """Check a weedline is added correctly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     pos = graphic.get_position()
     graphic.set_weedline(True)
     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
Пример #9
0
 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
Пример #10
0
 def test_translate_2(self):
     """Check that graphic is translated properly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     graphic.set_position(500, 237.21)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
     assert map(lambda x: round(x, 10), graphic.get_position()) == [
         500, 237.21
     ], "Position should be 500,237.21!"
Пример #11
0
 def test_weedline_3(self):
     """Check a weedline padding is added correctly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     h = graphic.get_height()
     w = graphic.get_width()
     graphic.set_weedline_padding(100)
     graphic.set_weedline(True)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
     assert graphic.get_height() == h + 200
     assert graphic.get_width() == w + 200
Пример #12
0
 def test_weedline_3(self):
     """Check a weedline padding is added correctly."""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     h = graphic.get_height()
     w = graphic.get_width()
     graphic.set_weedline_padding(100)
     graphic.set_weedline(True)
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
     assert graphic.get_height() == h + 200
     assert graphic.get_width() == w + 200
Пример #13
0
 def test_case_2(self):
     """Create a graphic from etree elements"""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
Пример #14
0
 def test_graphic_from_string(self):
     """Create a graphic from string"""
     graphic = Graphic(etree.tostring(etree.parse("arrow.svg")))
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
Пример #15
0
 def test_case_2(self):
     """Create a graphic from etree elements"""
     graphic = Graphic(etree.parse("arrow.svg").getroot())
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()
Пример #16
0
 def test_graphic_from_string(self):
     """Create a graphic from string"""
     graphic = Graphic(etree.tostring(etree.parse("arrow.svg")))
     f = open("out/arrow_%s.svg" % sys._getframe().f_code.co_name, "w")
     f.write(graphic.get_xml())
     f.close()