def test_build_metric_dimensions_with_host_from_value_list(self): self.server.set_expected_response("Error", 404) self.config_helper.host = "" vl = self._get_vl_mock("aggregation", "cpu-average", "cpu", "idle") metric_data_builder = MetricDataBuilder(self.config_helper, vl) dimensions = metric_data_builder._build_metric_dimensions() self.assertEquals("MockHost", dimensions['Host'])
def test_buoild_metric_dimensions_with_no_plugin_instance(self): vl = self._get_vl_mock("plugin", "", "type", "") metric_data_builder = MetricDataBuilder(self.config_helper, vl) dimensions = metric_data_builder._build_metric_dimensions() self.assertEquals("NONE", dimensions['PluginInstance'])
def test_build_metric_dimensions(self): vl = self._get_vl_mock("aggregation", "cpu-average", "cpu", "idle") metric_data_builder = MetricDataBuilder(self.config_helper, vl) dimensions = metric_data_builder._build_metric_dimensions() self.assertEquals("cpu-average", dimensions['PluginInstance']) self.assertEquals("valid_host", dimensions['Host'])