コード例 #1
0
class TestChart(unittest.TestCase):
    def setUp(self):
        self.chart_factory = ChartFactory()

    def test_render(self):
        expected_chart_name = 'test_chart'
        renderer = partial(self.chart_factory.get_renderer(class_name='discreteBarChart'), name=expected_chart_name)
        data = Series({'BD': 4, 'Divers': 1, 'Jeunesse': 1, 'Roman': 3, 'Roman Noir': 1})
        chart = self.chart_factory.render(data=data, renderer=renderer)
        self.assertEqual(chart.name, expected_chart_name)
        self.assertIsNotNone(chart.htmlcontent)
        self.assertIsNotNone(chart.container)
コード例 #2
0
class TestChart(unittest.TestCase):
    def setUp(self):
        self.chart_factory = ChartFactory()

    def test_render(self):
        expected_chart_name = 'test_chart'
        renderer = partial(
            self.chart_factory.get_renderer(class_name='discreteBarChart'),
            name=expected_chart_name)
        data = Series({
            'BD': 4,
            'Divers': 1,
            'Jeunesse': 1,
            'Roman': 3,
            'Roman Noir': 1
        })
        chart = self.chart_factory.render(data=data, renderer=renderer)
        self.assertEqual(chart.name, expected_chart_name)
        self.assertIsNotNone(chart.htmlcontent)
        self.assertIsNotNone(chart.container)
コード例 #3
0
class TestChart(unittest.TestCase):
    def setUp(self):
        self.chart_factory = ChartFactory()

    def test_render(self):
        expected_chart_name = "test_chart"
        renderer = partial(
            self.chart_factory.get_renderer(class_name="discreteBarChart"),
            name=expected_chart_name,
        )
        data = Series({
            "BD": 4,
            "Divers": 1,
            "Jeunesse": 1,
            "Roman": 3,
            "Roman Noir": 1
        })
        chart = self.chart_factory.render(data=data, renderer=renderer)
        self.assertEqual(chart.name, expected_chart_name)
        self.assertIsNotNone(chart.htmlcontent)
        self.assertIsNotNone(chart.container)