def test_sort_stacked_only_stack(self):
     seriesList = self._generate_series_list()
     seriesList[0].options = 'stacked'
     seriesList[1].options = 'stacked'
     seriesList[2].options = 'stacked'
     self.assertEqual(glyph.sort_stacked(copy.deepcopy(seriesList)),
                      seriesList)
    def test_sort_stacked_invalid_inputs(self):
        with self.assertRaises(TypeError):
            glyph.sort_stacked(None)

        with self.assertRaises(TypeError):
            glyph.sort_stacked(1)

        with self.assertRaises(AttributeError):
            glyph.sort_stacked('string')
    def test_sort_stacked_invalid_inputs(self):
      with self.assertRaises(TypeError):
        glyph.sort_stacked(None)

      with self.assertRaises(TypeError):
        glyph.sort_stacked(1)

      with self.assertRaises(AttributeError):
        glyph.sort_stacked('string')
 def test_sort_stacked_no_stack(self):
     seriesList = self._generate_series_list()
     self.assertEqual(glyph.sort_stacked(seriesList), seriesList)
 def test_sort_stacked_empty_input(self):
     self.assertEqual(glyph.sort_stacked(''), [])
 def test_sort_stacked_stack_and_no_stack(self):
     seriesList = self._generate_series_list()
     seriesList[0].options='stacked'
     seriesList[2].options='stacked'
     self.assertEqual(glyph.sort_stacked(copy.deepcopy(seriesList)), [seriesList[0],seriesList[2],seriesList[1]])
 def test_sort_stacked_no_stack(self):
     seriesList = self._generate_series_list()
     self.assertEqual(glyph.sort_stacked(seriesList), seriesList)
 def test_sort_stacked_empty_input(self):
     self.assertEqual(glyph.sort_stacked(''), [])
 def test_sort_stacked_only_stack(self):
     seriesList = self._generate_series_list()
     seriesList[0].options = "stacked"
     seriesList[1].options = "stacked"
     seriesList[2].options = "stacked"
     self.assertEqual(glyph.sort_stacked(copy.deepcopy(seriesList)), seriesList)