Skip to content

Commit

Permalink
Add eq tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Apr 18, 2024
1 parent caeadc7 commit fad3e03
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions tests/config/test_pulumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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])
Expand Down

0 comments on commit fad3e03

Please sign in to comment.