def test_serialised(self, line_chart, datadir):
     """Check the serialised file against sample"""
     cw = LineChartWriter(line_chart)
     xml = cw.write()
     tree = fromstring(xml)
     chart_schema.assertValid(tree)
     datadir.chdir()
     with open("LineChart.xml") as expected:
         diff = compare_xml(xml, expected.read())
         assert diff is None, diff
Exemple #2
0
 def test_serialised(self, line_chart):
     """Check the serialised file against sample"""
     cw = LineChartWriter(line_chart)
     xml = cw.write()
     tree = fromstring(xml)
     chart_schema.assertValid(tree)
     expected_file = os.path.join(DATADIR, "writer", "expected",
                                  "LineChart.xml")
     with open(expected_file) as expected:
         diff = compare_xml(xml, expected.read())
         assert diff is None, diff
    def test_write_chart(self, line_chart):
        """check if some characteristic tags of LineChart are there"""
        cw = LineChartWriter(line_chart)
        cw._write_chart()
        tagnames = ['{%s}lineChart' % CHART_NS,
                    '{%s}valAx' % CHART_NS,
                    '{%s}catAx' % CHART_NS]

        root = safe_iterator(cw.root)
        chart_tags = [e.tag for e in root]
        for tag in tagnames:
            assert tag in chart_tags