Пример #1
0
    def test_make_HTML_table(self):
        """make_HTML_table should Make HTML tables for one set charts"""

        #test pie charts
        fracs_labels_other,fracs_labels,all_counts,other_cat,red,other_frac = \
                                        get_fracs(self.counts1,5,10,'pie')

        img_data = make_HTML_table("Phylum",other_frac,10,red,other_cat,\
                                   fracs_labels_other,fracs_labels,\
                                   self.dir_path,all_counts,1,self.prefs,\
                                   self.color_prefs,'black','white','pie',\
                                   'Test1',\
                                   self.generate_image_type,self.plot_width,\
                                   self.plot_height,self.bar_width,self.dpi,0,\
                                   'categorical',False,False)
        
        self.assertEqual(len(img_data),2)
        
        #test area charts
        fracs_labels_other,fracs_labels,all_counts,other_cat,red,other_frac = \
                                        get_fracs(self.counts1,5,10,'area')

        img_data = make_HTML_table("Phylum",other_frac,10,red,other_cat,\
                                   fracs_labels_other,fracs_labels,\
                                   self.dir_path,all_counts,1,self.prefs,\
                                   self.color_prefs,'black','white','pie',\
                                   'Test1',\
                                   self.generate_image_type,self.plot_width,\
                                   self.plot_height,self.bar_width,self.dpi,0,\
                                   'categorical',False,False)
        
        self.assertEqual(len(img_data),2)
        
        #test bar charts
        fracs_labels_other,fracs_labels,all_counts,other_cat,red,other_frac = \
                                        get_fracs(self.counts1,5,10,'bar')

        img_data = make_HTML_table("Phylum",other_frac,10,red,other_cat,\
                                   fracs_labels_other,fracs_labels,\
                                   self.dir_path,all_counts,1,self.prefs,\
                                   self.color_prefs,'black','white','pie',\
                                   'Test1',\
                                   self.generate_image_type,self.plot_width,\
                                   self.plot_height,self.bar_width,self.dpi,0,\
                                   'categorical',False,False)
        
        self.assertEqual(len(img_data),2)
        self._paths_to_clean_up = ["/tmp/qiimewebfiles/charts/"+f \
                                  for f in listdir("/tmp/qiimewebfiles/charts")]
Пример #2
0
    def test_make_HTML_table(self):
        """make_HTML_table should Make HTML tables for one set charts"""

        # test pie charts
        fracs_labels_other, fracs_labels, all_counts, other_cat, red, other_frac = get_fracs(self.counts1, 5, 10, "pie")

        img_data = make_HTML_table(
            "Phylum",
            other_frac,
            10,
            red,
            other_cat,
            fracs_labels_other,
            fracs_labels,
            self.dir_path,
            all_counts,
            1,
            self.prefs,
            self.color_prefs,
            "black",
            "white",
            "pie",
            "Test1",
            self.generate_image_type,
            self.plot_width,
            self.plot_height,
            self.bar_width,
            self.dpi,
            0,
            "categorical",
            False,
        )

        self.assertEqual(len(img_data), 2)

        # test area charts
        fracs_labels_other, fracs_labels, all_counts, other_cat, red, other_frac = get_fracs(
            self.counts1, 5, 10, "area"
        )

        img_data = make_HTML_table(
            "Phylum",
            other_frac,
            10,
            red,
            other_cat,
            fracs_labels_other,
            fracs_labels,
            self.dir_path,
            all_counts,
            1,
            self.prefs,
            self.color_prefs,
            "black",
            "white",
            "pie",
            "Test1",
            self.generate_image_type,
            self.plot_width,
            self.plot_height,
            self.bar_width,
            self.dpi,
            0,
            "categorical",
            False,
        )

        self.assertEqual(len(img_data), 2)

        # test bar charts
        fracs_labels_other, fracs_labels, all_counts, other_cat, red, other_frac = get_fracs(self.counts1, 5, 10, "bar")

        img_data = make_HTML_table(
            "Phylum",
            other_frac,
            10,
            red,
            other_cat,
            fracs_labels_other,
            fracs_labels,
            self.dir_path,
            all_counts,
            1,
            self.prefs,
            self.color_prefs,
            "black",
            "white",
            "pie",
            "Test1",
            self.generate_image_type,
            self.plot_width,
            self.plot_height,
            self.bar_width,
            self.dpi,
            0,
            "categorical",
            False,
        )

        self.assertEqual(len(img_data), 2)
        self._paths_to_clean_up = ["/tmp/qiimewebfiles/charts/" + f for f in listdir("/tmp/qiimewebfiles/charts")]