def test_color(self): seriesList = self._generate_series_list() color = "red" # Leave the original seriesList unmodified results = functions.color({}, copy.deepcopy(seriesList), color) for i, series in enumerate(results): self.assertTrue(hasattr(series, "color"), "The transformed seriesList is missing the 'color' attribute") self.assertFalse( hasattr(seriesList[i], "color"), "The original seriesList shouldn't have a 'color' attribute" ) self.assertEqual(series.color, color)
def test_color(self): seriesList = self._generate_series_list() color = "red" # Leave the original seriesList unmodified results = functions.color({}, copy.deepcopy(seriesList), color) for i, series in enumerate(results): self.assertTrue(hasattr(series, "color"), "The transformed seriesList is missing the 'color' attribute", ) self.assertFalse(hasattr(seriesList[i], "color"), "The original seriesList shouldn't have a 'color' attribute", ) self.assertEqual(series.color, color)