MCPcopy Create free account
hub / github.com/scanny/python-pptx / populate_fixture

Method populate_fixture

tests/chart/test_xlsx.py:396–415  ·  view source on GitHub ↗
(self, workbook_, worksheet_)

Source from the content-addressed store, hash-verified

394
395 @pytest.fixture
396 def populate_fixture(self, workbook_, worksheet_):
397 chart_data = XyChartData()
398 series_1 = chart_data.add_series("Series 1")
399 for pt in ((1, 1.1), (2, 2.2)):
400 series_1.add_data_point(*pt)
401 series_2 = chart_data.add_series("Series 2")
402 for pt in ((3, 3.3), (4, 4.4)):
403 series_2.add_data_point(*pt)
404
405 workbook_writer = XyWorkbookWriter(chart_data)
406
407 expected_calls = [
408 call.write_column(1, 0, [1, 2], ANY),
409 call.write(0, 1, "Series 1"),
410 call.write_column(1, 1, [1.1, 2.2], ANY),
411 call.write_column(5, 0, [3, 4], ANY),
412 call.write(4, 1, "Series 2"),
413 call.write_column(5, 1, [3.3, 4.4], ANY),
414 ]
415 return workbook_writer, workbook_, worksheet_, expected_calls
416
417 # fixture components ---------------------------------------------
418

Callers

nothing calls this directly

Calls 5

add_seriesMethod · 0.95
XyChartDataClass · 0.90
XyWorkbookWriterClass · 0.90
add_data_pointMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected