From 82f7e93c83c6922167a2b531ac70f8e2a29fd9eb Mon Sep 17 00:00:00 2001 From: Santiago Mola Date: Mon, 10 Feb 2025 12:57:44 +0100 Subject: [PATCH] Consolidate remote config tests into same directory/file --- .../test_remote_configuration.py | 19 +++++++++++++++ tests/test_remote_config.py | 24 ------------------- 2 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 tests/test_remote_config.py diff --git a/tests/remote_config/test_remote_configuration.py b/tests/remote_config/test_remote_configuration.py index 9e7056a2600..efea0d45c1b 100644 --- a/tests/remote_config/test_remote_configuration.py +++ b/tests/remote_config/test_remote_configuration.py @@ -21,6 +21,25 @@ from utils.tools import logger +@rfc("https://docs.google.com/document/d/1bUVtEpXNTkIGvLxzkNYCxQzP2X9EK9HMBLHWXr_5KLM/edit#heading=h.vy1jegxy7cuc") +@features.remote_config_object_supported +class Test_NoError: + """A library should apply with no error all remote config payload.""" + + def test_no_error(self): + def no_error(data): + config_states = ( + data.get("request", {}).get("content", {}).get("client", {}).get("state", {}).get("config_states", {}) + ) + + for state in config_states: + error = state.get("apply_error", None) + if error is not None: + raise Exception(f"Error in remote config application: {error}") + + interfaces.library.validate_remote_configuration(no_error, success_by_default=True) + + @rfc("https://docs.google.com/document/d/1u_G7TOr8wJX0dOM_zUDKuRJgxoJU_hVTd5SeaMucQUs/edit#heading=h.octuyiil30ph") @features.remote_config_object_supported class RemoteConfigurationFieldsBasicTests: diff --git a/tests/test_remote_config.py b/tests/test_remote_config.py deleted file mode 100644 index 535a2773b07..00000000000 --- a/tests/test_remote_config.py +++ /dev/null @@ -1,24 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2021 Datadog, Inc. - -from utils import rfc, interfaces, features - - -@rfc("https://docs.google.com/document/d/1bUVtEpXNTkIGvLxzkNYCxQzP2X9EK9HMBLHWXr_5KLM/edit#heading=h.vy1jegxy7cuc") -@features.remote_config_object_supported -class Test_NoError: - """A library should apply with no error all remote config payload.""" - - def test_no_error(self): - def no_error(data): - config_states = ( - data.get("request", {}).get("content", {}).get("client", {}).get("state", {}).get("config_states", {}) - ) - - for state in config_states: - error = state.get("apply_error", None) - if error is not None: - raise Exception(f"Error in remote config application: {error}") - - interfaces.library.validate_remote_configuration(no_error, success_by_default=True)