Exemple #1
0
 def test_serialised(self, pie_chart, datadir):
     """Check the serialised file against sample"""
     cw = PieChartWriter(pie_chart)
     xml = cw.write()
     tree = fromstring(xml)
     chart_schema.assertValid(tree)
     datadir.chdir()
     with open("PieChart.xml") as expected:
         diff = compare_xml(xml, expected.read())
     assert diff is None, diff
 def test_serialised(self, pie_chart, datadir):
     """Check the serialised file against sample"""
     cw = PieChartWriter(pie_chart)
     xml = cw.write()
     tree = fromstring(xml)
     chart_schema.assertValid(tree)
     datadir.chdir()
     with open("PieChart.xml") as expected:
         diff = compare_xml(xml, expected.read())
     assert diff is None, diff
    def test_write_chart(self, pie_chart):
        """check if some characteristic tags of PieChart are there"""
        cw = PieChartWriter(pie_chart)
        cw._write_chart()

        tagnames = ['{%s}pieChart' % CHART_NS, '{%s}varyColors' % CHART_NS]
        root = safe_iterator(cw.root)
        chart_tags = [e.tag for e in root]
        for tag in tagnames:
            assert tag in chart_tags

        assert 'c:catAx' not in chart_tags
Exemple #4
0
    def test_write_chart(self, pie_chart):
        """check if some characteristic tags of PieChart are there"""
        cw = PieChartWriter(pie_chart)
        cw._write_chart()

        tagnames = ['{%s}pieChart' % CHART_NS,
                    '{%s}varyColors' % CHART_NS
                    ]
        root = safe_iterator(cw.root)
        chart_tags = [e.tag for e in root]
        for tag in tagnames:
            assert tag in chart_tags

        assert 'c:catAx' not in chart_tags