From 7ec97e4345ee6a0f006fa03f5bafd50430d859f0 Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Thu, 18 Apr 2024 11:50:22 +0100 Subject: [PATCH] Add extra delitem tests --- tests/config/test_pulumi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/config/test_pulumi.py b/tests/config/test_pulumi.py index 9ca030b9dc..a31ebcba6c 100644 --- a/tests/config/test_pulumi.py +++ b/tests/config/test_pulumi.py @@ -79,6 +79,14 @@ def test_delitem(self, pulumi_config): del pulumi_config["my_stack"] assert len(pulumi_config.stacks) == 1 + def test_delitem_value_error(self, pulumi_config): + with raises(TypeError, match="'key' must be a string."): + del pulumi_config[-1] + + def test_delitem_index_error(self, pulumi_config): + with raises(IndexError, match="No configuration for Pulumi stack Ringo."): + del pulumi_config["Ringo"] + def test_stack_names(self, pulumi_config): assert "my_stack" in pulumi_config.stack_names