Skip to content

Commit

Permalink
Add tests for object raw setter (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Jun 11, 2024
1 parent 03abab8 commit e2b04bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kr8s/tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,3 +1096,15 @@ def test_new_class_plural_suffix():
instance = MyPolicy({})
assert instance.plural == "mypolicies"
assert instance.endpoint == "mypolicies"


def test_object_setter(example_pod_spec):
po = Pod(example_pod_spec)

assert po.name != "foo"
po.raw["metadata"]["name"] = "foo"
assert po.name == "foo"

assert po.raw["spec"]["containers"][0]["name"] != "bar"
po.raw["spec"]["containers"][0]["name"] = "bar"
assert po.raw["spec"]["containers"][0]["name"] == "bar"

0 comments on commit e2b04bc

Please sign in to comment.