def test_PlanObject(self): inst = PlanObject(self.params, '.', self.conf) #checking if members exist self.assertTrue(hasattr(inst, 'template_file'), "Base doesn't contain template_file") self.assertTrue(hasattr(inst, 'data_source'), "Base doesn't contain data_source") self.assertTrue(hasattr(inst, 'source_type'), "Base doesn't contain source_type") self.assertTrue(hasattr(inst, 'sampling'), "Base doesn't contain sampling") inst.gather_statistics('device_grid_widget', 'ALL') for stat in Configurator.OPTIMIZER_STATISTICS['ALL']: self.assertTrue(hasattr(inst, stat), "Base doesn't contain {0}".format(stat))
def _geo_lookup_plan(self, source_id, params, conf): plan = PlanObject(params, source_id, conf) plan.data_source = 'vertica-dashboard' plan.template_file = 'geo_lookup.sql' return plan
def _geo_widget_plan(self, source_id, params, conf): plan = PlanObject(params, source_id, conf) # here comes the logic around the params plan.data_source = 'vertica-dashboard' plan.template_file = 'geo_widget.sql' return plan