From 8a96f7bc1a06684ef79994aca30366a4e63d0ce3 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:31:46 +0100 Subject: [PATCH] extends tests --- services/autoscaling/tests/unit/test_core_settings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/autoscaling/tests/unit/test_core_settings.py b/services/autoscaling/tests/unit/test_core_settings.py index e822543eb298..652d6d9ac98a 100644 --- a/services/autoscaling/tests/unit/test_core_settings.py +++ b/services/autoscaling/tests/unit/test_core_settings.py @@ -208,10 +208,16 @@ def test_EC2_INSTANCES_ALLOWED_TYPES_empty_not_allowed( # noqa: N802 # now as part of AUTOSCALING_EC2_INSTANCES: EC2InstancesSettings | None assert os.environ["AUTOSCALING_EC2_INSTANCES"] == "{}" + + with pytest.raises(ValidationError) as err_info: + ApplicationSettings.create_from_envs(AUTOSCALING_EC2_INSTANCES={}) + + before = err_info.value.errors() + with pytest.raises(ValidationError) as err_info: ApplicationSettings.create_from_envs() - assert err_info.value.errors() + assert err_info.value.errors() == before # removing any value for AUTOSCALING_EC2_INSTANCES monkeypatch.delenv("AUTOSCALING_EC2_INSTANCES")