def test_substr(self): series = self._generate_series_list(config=[range(100)]) sub = functions.substr({}, series, 1)[0] self.assertEqual(sub.name, "test-db1.load.value") series = functions.alias({}, self._generate_series_list(config=[range(100)]), '(foo.bar, "baz")') sub = functions.substr({}, series, 1)[0] self.assertEqual(sub.name, "bar") series = self._generate_series_list(config=[range(100)]) sub = functions.substr({}, series, 0, 2)[0] self.assertEqual(sub.name, "collectd.test-db1")
def test_substr(self): series = self._generate_series_list(config=[range(100)]) sub = functions.substr({}, series, 1)[0] self.assertEqual(sub.name, "test-db1.load.value") series = functions.alias( {}, self._generate_series_list(config=[range(100)]), '(foo.bar, "baz")') sub = functions.substr({}, series, 1)[0] self.assertEqual(sub.name, "bar") series = self._generate_series_list(config=[range(100)]) sub = functions.substr({}, series, 0, 2)[0] self.assertEqual(sub.name, "collectd.test-db1")
def test_alias(self): seriesList = self._generate_series_list() substitution = "Ni!" results = functions.alias({}, seriesList, substitution) for series in results: self.assertEqual(series.name, substitution)