예제 #1
0
 def test_ctor(self):
     from openpyxl.chart import Axis, Legend
     from openpyxl.drawing import Drawing
     c = Chart(None, None)
     eq_(c.type, None)
     eq_(c.grouping, None)
     assert_true(isinstance(c.x_axis, Axis))
     assert_true(isinstance(c.y_axis, Axis))
     assert_true(isinstance(c.legend, Legend))
     eq_(c.show_legend, True)
     eq_(c.lang, 'fr-FR')
     eq_(c.title, '')
     eq_(c.print_margins, {
         'b': .75,
         'l': .7,
         'r': .7,
         't': .75,
         'header': 0.3,
         'footer': .3
     })
     assert_true(isinstance(c.drawing, Drawing))
     eq_(c.width, .6)
     eq_(c.height, .6)
     eq_(c.margin_top, c._get_max_margin_top())
     eq_(c.margin_left, 0)
     eq_(c._shapes, [])
예제 #2
0
파일: test_chart.py 프로젝트: Khan/openpyxl
 def test_ctor(self):
     from openpyxl.chart import Axis, Legend
     from openpyxl.drawing import Drawing
     c = Chart(None, None)
     eq_(c.type, None)
     eq_(c.grouping, None)
     assert_true(isinstance(c.x_axis, Axis))
     assert_true(isinstance(c.y_axis, Axis))
     assert_true(isinstance(c.legend, Legend))
     eq_(c.show_legend, True)
     eq_(c.lang, 'fr-FR')
     eq_(c.title, '')
     eq_(c.print_margins,
         {'b':.75, 'l':.7, 'r':.7, 't':.75, 'header':0.3, 'footer':.3}
         )
     assert_true(isinstance(c.drawing, Drawing))
     eq_(c.width, .6)
     eq_(c.height, .6)
     eq_(c.margin_top, c._get_max_margin_top())
     eq_(c.margin_left, 0)
     eq_(c._shapes, [])
예제 #3
0
 def test_get_max_margin_top(self):
     c = Chart(None, None)
     eq_(c._get_max_margin_top(), 0.21250000000000005)