def setUp(self): # api keys with admin and viewer level permissions self.ADMIN = Grafana.create_api_key(HOST, "admin", "Admin") self.VIEWER = Grafana.create_api_key(HOST, "viewer", "Viewer") self.login_url = "mercury:EventAccess" self.sensor_url = "mercury:sensor" self.event_url = "mercury:events" self.config_url = "mercury:gfconfig" self.config_update_url = "mercury:gfconfig_update" self.config_delete_url = "mercury:gfconfig_delete" self.config_update_dashboard_url = "mercury:gfconfig_update_dashboard" self.config_reset_dashboard_url = "mercury:gfconfig_reset_dashboard" self.config_delete_dashboard_url = "mercury:gfconfig_delete_dashboard" self.config_add_dashboard_url = "mercury:gfconfig_create_dashboard" test_code = EventCodeAccess(event_code="testcode", enabled=True) test_code.save() # Login self._get_with_event_code(self.sensor_url, self.TESTCODE) self.gfconfig = GFConfig.objects.create(gf_name="Test", gf_host=HOST, gf_token=self.ADMIN, gf_current=True) self.gfconfig.save() # Create fresh grafana object self.grafana = Grafana(self.gfconfig) # Create random name to be used for event and datasource self.event_name = self.grafana.generate_random_string(10) self.datasource_name = self.grafana.generate_random_string(10) # Clear existing dashboard and datasource self.grafana.delete_all_dashboards() self.grafana.delete_all_datasources()
def setUp(self): # api keys with admin and viewer level permissions self.ADMIN = Grafana.create_api_key(HOST, "admin", "Admin") self.VIEWER = Grafana.create_api_key(HOST, "viewer", "Viewer") self.login_url = "mercury:EventAccess" self.sensor_url = "mercury:sensor" self.event_url = "mercury:events" self.event_delete_url = "mercury:delete_event" self.event_update_url = "mercury:update_event" self.update_sensor_url = "mercury:update_sensor" self.delete_sensor_url = "mercury:delete_sensor" self.update_sensor_type_url = "mercury:update_type" test_code = EventCodeAccess(event_code="testcode", enabled=True) test_code.save() # Login self._get_with_event_code(self.sensor_url, self.TESTCODE) # Create fresh grafana object self.config = self.create_gfconfig() self.grafana = Grafana(self.config) # Create random name to be used for event and datasource self.event_name = self.grafana.generate_random_string(10) self.updated_event_name = self.event_name + " Day Two" self.datasource_name = self.grafana.generate_random_string(10) # Clear existing dashboard and datasource self.grafana.delete_all_dashboards() self.grafana.delete_all_datasources()
def setUp(self): self.login_url = "mercury:EventAccess" self.sensor_url = "mercury:sensor" self.sensor_data_exists_url = "mercury:sensor_data_exists" self.event_data_exists_url = "mercury:event_data_exists" test_code = EventCodeAccess(event_code="testcode", enabled=True) test_code.save()
def setUp(self): self.login_url = "mercury:EventAccess" self.event_url = "mercury:events" self.event_delete_url = "mercury:delete_event" self.event_update_url = "mercury:update_event" self.venue_update_url = "mercury:update_venue" self.event_activate_url = "mercury:activate_event" self.event_deactivate_url = "mercury:deactivate_event" self.event_export_csv_url = "mercury:export_csv" self.event_export_all_csv_url = "mercury:export_all_csv" self.event_export_json_url = "mercury:export_json" self.event_export_all_json_url = "mercury:export_all_json" # Create random event name self.event_name = "test" test_code = EventCodeAccess(event_code=self.TESTCODE, enabled=True) test_code.save()
def setUp(self): test_code = EventCodeAccess(event_code="testcode", enabled=True) test_code.save()
def setUp(self): self.login_url = "mercury:EventAccess" self.event_url = "mercury:events" test_code = EventCodeAccess(event_code=self.TESTCODE, enabled=True) test_code.save()