def setup_class(cls): # Generate a config file for the dog shell cls.config_fn, cls.config_file = get_temp_file() config = ConfigParser() config.add_section("Connection") config.set("Connection", "apikey", os.environ["DD_TEST_CLIENT_API_KEY"]) config.set("Connection", "appkey", os.environ["DD_TEST_CLIENT_APP_KEY"]) config.set("Connection", "api_host", os.environ.get("DATADOG_HOST", "https://api.datadoghq.com")) config.write(cls.config_file) cls.config_file.flush()
def setUp(self): # Generate a config file for the dog shell self.config_fn, self.config_file = get_temp_file() config = ConfigParser() config.add_section('Connection') config.set('Connection', 'apikey', os.environ['DATADOG_API_KEY']) config.set('Connection', 'appkey', os.environ['DATADOG_APP_KEY']) config.set('Connection', 'api_host', os.environ['DATADOG_HOST']) config.write(self.config_file) self.config_file.flush()
def dogshell_config(): config = ConfigParser() config.add_section("Connection") config.set("Connection", "apikey", API_KEY) config.set("Connection", "appkey", APP_KEY) config.set("Connection", "api_host", os.environ.get("DATADOG_HOST", "https://api.datadoghq.com")) return config
def setUp(self): # Generate a config file for the dog shell self.config_fn, self.config_file = get_temp_file() config = ConfigParser() config.add_section('Connection') config.set('Connection', 'apikey', os.environ['DD_TEST_CLIENT_API_KEY']) config.set('Connection', 'appkey', os.environ['DD_TEST_CLIENT_APP_KEY']) config.set('Connection', 'api_host', os.environ.get('DATADOG_HOST', 'https://api.datadoghq.com')) config.write(self.config_file) self.config_file.flush()