def test_save_single_ave_rarefaction_plots(self):
        '''save_single_ave_rarefaction_plots: this tests the functionality of
           creating a rarefaction plot based on the average rarefaction
           values'''

        filename1 = '/tmp/test1col_0_row_0_ave.png'
        self._paths_to_clean_up = [filename1]

        exp = {
            'test': {'groups': {'SampleID': {'Sample1': {'groupcolor': '#ff0000',
                                                         'ave_link':
                                                         'html_plots/testcol_0_row_0_ave.png',
                                                         'groupsamples': ['Sample1']}}},
                     'samples': {'Sample1': {'color': '#ff0000',
                                             'link': 'html_plots/testcol_0_row_0.png'}}}}

        obs = save_single_ave_rarefaction_plots(self.data['xaxis'],
                                                self.data['yvals'], self.data[
                                                    'err'],
                                                self.xmax, self.ymax, self.ops, self.mapping_category,
                                                self.imagetype, self.resolution, self.data_colors,
                                                self.colors, '/tmp/test1', self.background_color,
                                                self.label_color, self.rarefaction_legend_mat,
                                                self.metric_name, self.mapping_lookup)

        self.assertEqual(obs, exp)
        self.assertTrue(exists(filename1))
Exemplo n.º 2
0
    def test_save_single_ave_rarefaction_plots(self):
        '''save_single_ave_rarefaction_plots: this tests the functionality of
           creating a rarefaction plot based on the average rarefaction
           values'''

        filename1 = '/tmp/test1col_0_row_0_ave.png'
        self._paths_to_clean_up = [filename1]

        exp = {
            'test': {'groups': {'SampleID': {'Sample1': {'groupcolor': '#ff0000',
                                                         'ave_link':
                                                         'html_plots/testcol_0_row_0_ave.png',
                                                         'groupsamples': ['Sample1']}}},
                     'samples': {'Sample1': {'color': '#ff0000',
                                             'link': 'html_plots/testcol_0_row_0.png'}}}}

        obs = save_single_ave_rarefaction_plots(self.data['xaxis'],
                                                self.data['yvals'], self.data[
                                                    'err'],
                                                self.xmax, self.ymax, self.ops, self.mapping_category,
                                                self.imagetype, self.resolution, self.data_colors,
                                                self.colors, '/tmp/test1', self.background_color,
                                                self.label_color, self.rarefaction_legend_mat,
                                                self.metric_name, self.mapping_lookup)

        self.assertEqual(obs, exp)
        self.assertTrue(exists(filename1))
    def test_save_single_ave_rarefaction_plots(self):
        """save_single_ave_rarefaction_plots: this tests the functionality of 
           creating a rarefaction plot based on the average rarefaction 
           values"""

        filename1 = "/tmp/test1col_0_row_0_ave.png"
        self._paths_to_clean_up = [filename1]

        exp = {
            "test": {
                "groups": {
                    "SampleID": {
                        "Sample1": {
                            "groupcolor": "#ff0000",
                            "ave_link": "html_plots/testcol_0_row_0_ave.png",
                            "groupsamples": ["Sample1"],
                        }
                    }
                },
                "samples": {"Sample1": {"color": "#ff0000", "link": "html_plots/testcol_0_row_0.png"}},
            }
        }

        obs = save_single_ave_rarefaction_plots(
            self.data["xaxis"],
            self.data["yvals"],
            self.data["err"],
            self.xmax,
            self.ymax,
            self.ops,
            self.mapping_category,
            self.imagetype,
            self.resolution,
            self.data_colors,
            self.colors,
            "/tmp/test1",
            self.background_color,
            self.label_color,
            self.rarefaction_legend_mat,
            self.metric_name,
            self.mapping_lookup,
        )

        self.assertEqual(obs, exp)
        self.assertTrue(exists(filename1))