コード例 #1
0
    def test_make_pie_chart(self):
        """make_pie_chart should create HTML source and pdfs for pie_charts"""

        filename1 = '/tmp/qiimewebfiles/charts/pie_chart.png'
        filename2 = '/tmp/qiimewebfiles/charts/pie_chart_legend.pdf'
        filename3 = '/tmp/qiimewebfiles/charts/pie_chart.pdf'

        obs1,obs2,obs3,obs4=make_pie_chart(self.fracs,self.dir_path,1,\
                    self.prefs,self.color_prefs, "black","white",\
                    self.generate_image_type,self.plot_width,\
                    self.plot_height,self.bar_width,self.dpi,False,\
                    file_prefix="pie_chart",\
                    props=self.props)

        self.assertTrue(
            exists(filename1), 'The png file was not created in \
the appropriate location')
        self.assertTrue(
            exists(filename2), 'The eps file was not created in \
the appropriate location')
        self.assertTrue(
            exists(filename3), 'The pdf file was not created in \
the appropriate location')
        self._paths_to_clean_up = ["/tmp/qiimewebfiles/charts/"+f \
                                  for f in listdir("/tmp/qiimewebfiles/charts")]
コード例 #2
0
    def test_make_pie_chart(self):
        """make_pie_chart should create HTML source and pdfs for pie_charts"""

        filename1 = "/tmp/qiimewebfiles/charts/pie_chart.png"
        filename2 = "/tmp/qiimewebfiles/charts/pie_chart_legend.pdf"
        filename3 = "/tmp/qiimewebfiles/charts/pie_chart.pdf"

        obs1, obs2, obs3, obs4 = make_pie_chart(
            self.fracs,
            self.dir_path,
            1,
            self.prefs,
            self.color_prefs,
            "black",
            "white",
            self.generate_image_type,
            self.plot_width,
            self.plot_height,
            self.bar_width,
            self.dpi,
            False,
            file_prefix="pie_chart",
            props=self.props,
        )

        self.assertTrue(
            exists(filename1),
            "The png file was not created in \
the appropriate location",
        )
        self.assertTrue(
            exists(filename2),
            "The eps file was not created in \
the appropriate location",
        )
        self.assertTrue(
            exists(filename3),
            "The pdf file was not created in \
the appropriate location",
        )
        self._paths_to_clean_up = ["/tmp/qiimewebfiles/charts/" + f for f in listdir("/tmp/qiimewebfiles/charts")]