Exemplo n.º 1
0
 def adjust_fixture(self, request, _add_cloned_sers_, _trim_ser_count_by_):
     new_ser_count, add, trim = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     plotArea = element(
         'c:plotArea/c:barChart/(c:ser/(c:idx{val=3},c:order{val=1}),c:se'
         'r/(c:idx{val=1},c:order{val=3}))')
     sers = plotArea.sers
     add_calls = [call(rewriter, plotArea, 1)] if add else []
     trim_calls = [call(rewriter, plotArea, 1)] if trim else []
     return rewriter, plotArea, new_ser_count, add_calls, trim_calls, sers
Exemplo n.º 2
0
 def adjust_fixture(self, request, _add_cloned_sers_, _trim_ser_count_by_):
     ser_count, add, trim = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     chartSpace = element(
         'c:chartSpace/(c:ser/(c:idx{val=3},c:order{val=1}),c:ser/(c:idx{'
         'val=1},c:order{val=3}))')
     sers = chartSpace.sers
     add_calls = [call(rewriter, chartSpace, 1)] if add else []
     trim_calls = [call(rewriter, chartSpace, 1)] if trim else []
     return rewriter, chartSpace, ser_count, add_calls, trim_calls, sers
Exemplo n.º 3
0
 def trim_fixture(self):
     rewriter = _BaseSeriesXmlRewriter(None)
     chartSpace = element(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/(c:idx{val=3},'
         'c:order{val=1}),c:ser/(c:idx{val=2},c:order{val=0}))')
     count = 1
     expected_xml = xml(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/(c:idx{val=0}'
         ',c:order{val=0}))')
     return rewriter, chartSpace, count, expected_xml
Exemplo n.º 4
0
 def adjust_fixture(self, request, _add_cloned_sers_, _trim_ser_count_by_):
     ser_count, add, trim = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     chartSpace = element(
         'c:chartSpace/(c:ser/(c:idx{val=3},c:order{val=1}),c:ser/(c:idx{'
         'val=1},c:order{val=3}))'
     )
     sers = chartSpace.sers
     add_calls = [call(rewriter, chartSpace, 1)] if add else []
     trim_calls = [call(rewriter, chartSpace, 1)] if trim else []
     return rewriter, chartSpace, ser_count, add_calls, trim_calls, sers
Exemplo n.º 5
0
 def adjust_fixture(self, request, _add_cloned_sers_, _trim_ser_count_by_):
     new_ser_count, add, trim = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     plotArea = element(
         'c:plotArea/c:barChart/(c:ser/(c:idx{val=3},c:order{val=1}),c:se'
         'r/(c:idx{val=1},c:order{val=3}))'
     )
     sers = plotArea.sers
     add_calls = [call(rewriter, plotArea, 1)] if add else []
     trim_calls = [call(rewriter, plotArea, 1)] if trim else []
     return rewriter, plotArea, new_ser_count, add_calls, trim_calls, sers
Exemplo n.º 6
0
 def trim_fixture(self):
     rewriter = _BaseSeriesXmlRewriter(None)
     chartSpace = element(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/(c:idx{val=3},'
         'c:order{val=1}),c:ser/(c:idx{val=2},c:order{val=0}))'
     )
     count = 1
     expected_xml = xml(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/(c:idx{val=0}'
         ',c:order{val=0}))'
     )
     return rewriter, chartSpace, count, expected_xml
Exemplo n.º 7
0
 def replace_fixture(self, request, chart_data_, _adjust_ser_count_,
                     _rewrite_ser_data_):
     rewriter = _BaseSeriesXmlRewriter(chart_data_)
     chartSpace = element('c:chartSpace/(c:ser,c:ser)')
     sers = chartSpace.xpath('c:ser')
     ser_count = len(sers)
     series_datas = [
         instance_mock(request, _BaseSeriesData),
         instance_mock(request, _BaseSeriesData),
     ]
     calls = [
         call(rewriter, sers[0], series_datas[0]),
         call(rewriter, sers[1], series_datas[1])
     ]
     chart_data_.__len__.return_value = len(series_datas)
     chart_data_.__iter__.return_value = iter(series_datas)
     _adjust_ser_count_.return_value = sers
     return rewriter, chartSpace, ser_count, calls
Exemplo n.º 8
0
 def replace_fixture(
         self, request, chart_data_, _adjust_ser_count_,
         _rewrite_ser_data_):
     rewriter = _BaseSeriesXmlRewriter(chart_data_)
     chartSpace = element('c:chartSpace/(c:ser,c:ser)')
     sers = chartSpace.xpath('c:ser')
     ser_count = len(sers)
     series_datas = [
         instance_mock(request, _BaseSeriesData),
         instance_mock(request, _BaseSeriesData),
     ]
     calls = [
         call(rewriter, sers[0], series_datas[0]),
         call(rewriter, sers[1], series_datas[1])
     ]
     chart_data_.__len__.return_value = len(series_datas)
     chart_data_.__iter__.return_value = iter(series_datas)
     _adjust_ser_count_.return_value = sers
     return rewriter, chartSpace, ser_count, calls
Exemplo n.º 9
0
 def replace_fixture(self, request, chart_data_, _adjust_ser_count_,
                     _rewrite_ser_data_):
     rewriter = _BaseSeriesXmlRewriter(chart_data_)
     chartSpace = element(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/c:order{val=0'
         '},c:ser/c:order{val=1})')
     plotArea = chartSpace.xpath('c:chart/c:plotArea')[0]
     sers = chartSpace.xpath('.//c:ser')
     ser_count = len(sers)
     series_datas = [
         instance_mock(request, _BaseSeriesData),
         instance_mock(request, _BaseSeriesData),
     ]
     calls = [
         call(rewriter, sers[0], series_datas[0], False),
         call(rewriter, sers[1], series_datas[1], False)
     ]
     chart_data_.__len__.return_value = len(series_datas)
     chart_data_.__iter__.return_value = iter(series_datas)
     return rewriter, chartSpace, plotArea, ser_count, calls
Exemplo n.º 10
0
 def replace_fixture(self, request, chart_data_, _adjust_ser_count_,
                     _rewrite_ser_data_):
     rewriter = _BaseSeriesXmlRewriter(chart_data_)
     chartSpace = element(
         'c:chartSpace/c:chart/c:plotArea/c:barChart/(c:ser/c:order{val=0'
         '},c:ser/c:order{val=1})'
     )
     plotArea = chartSpace.xpath('c:chart/c:plotArea')[0]
     sers = chartSpace.xpath('.//c:ser')
     ser_count = len(sers)
     series_datas = [
         instance_mock(request, _BaseSeriesData),
         instance_mock(request, _BaseSeriesData),
     ]
     calls = [
         call(rewriter, sers[0], series_datas[0], False),
         call(rewriter, sers[1], series_datas[1], False)
     ]
     chart_data_.__len__.return_value = len(series_datas)
     chart_data_.__iter__.return_value = iter(series_datas)
     return rewriter, chartSpace, plotArea, ser_count, calls
Exemplo n.º 11
0
 def trim_fixture(self, request):
     plotArea_cxml, count, expected_cxml = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     plotArea = element(plotArea_cxml)
     expected_xml = xml(expected_cxml)
     return rewriter, plotArea, count, expected_xml
Exemplo n.º 12
0
 def trim_fixture(self, request):
     plotArea_cxml, count, expected_cxml = request.param
     rewriter = _BaseSeriesXmlRewriter(None)
     plotArea = element(plotArea_cxml)
     expected_xml = xml(expected_cxml)
     return rewriter, plotArea, count, expected_xml