From fad3e03946df814209b92768280231fcd453082e Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Thu, 18 Apr 2024 13:45:10 +0100 Subject: [PATCH] Add eq tests --- tests/config/test_pulumi.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/config/test_pulumi.py b/tests/config/test_pulumi.py index e2e5a81c1c..9a7fb37ace 100644 --- a/tests/config/test_pulumi.py +++ b/tests/config/test_pulumi.py @@ -23,17 +23,6 @@ def pulumi_stack(stack_config_encoded): return PulumiStack(name="my_stack", config=stack_config_encoded) -class TestPulumiStack: - def test_pulumi_stack(self, pulumi_stack): - assert pulumi_stack.name == "my_stack" - assert "encryptedkey: zjhejU2XsOKLo95w9CLD" in pulumi_stack.config - - def test_dump(self, pulumi_stack, stack_config_encoded): - d = pulumi_stack.model_dump() - assert d.get("name") == "my_stack" - assert d.get("config") == stack_config_encoded - - @fixture def pulumi_stack2(): return PulumiStack( @@ -48,6 +37,23 @@ def pulumi_stack2(): ) +class TestPulumiStack: + def test_pulumi_stack(self, pulumi_stack): + assert pulumi_stack.name == "my_stack" + assert "encryptedkey: zjhejU2XsOKLo95w9CLD" in pulumi_stack.config + + def test_dump(self, pulumi_stack, stack_config_encoded): + d = pulumi_stack.model_dump() + assert d.get("name") == "my_stack" + assert d.get("config") == stack_config_encoded + + def test_eq(self, pulumi_stack): + assert pulumi_stack == pulumi_stack.model_copy(deep=True) + + def test_not_eq(self, pulumi_stack, pulumi_stack2): + assert pulumi_stack != pulumi_stack2 + + @fixture def pulumi_config(pulumi_stack, pulumi_stack2): return PulumiConfig(stacks=[pulumi_stack, pulumi_stack2])