Skip to content

Commit dc71975

Browse files
Add creation unit test
1 parent 330bc36 commit dc71975

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

test/unit/objects/lke_test.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,30 @@ def test_populate_with_mixed_types(self):
499499
assert self.pool.nodes[1].id == "node8"
500500
assert self.pool.nodes[2].id == "node9"
501501

502-
def test_cluster_update_null_addresses(self):
502+
def test_cluster_create_acl_null_addresses(self):
503+
with self.mock_post("lke/clusters") as m:
504+
self.client.lke.cluster_create(
505+
region="us-mia",
506+
label="foobar",
507+
kube_version="1.32",
508+
node_pools=[self.client.lke.node_pool("g6-standard-1", 3)],
509+
control_plane={
510+
"acl": {
511+
"enabled": False,
512+
"addresses": None,
513+
}
514+
},
515+
)
516+
517+
# Addresses should not be included in the API request if it's null
518+
# See: TPT-3489
519+
assert m.call_data["control_plane"] == {
520+
"acl": {
521+
"enabled": False,
522+
}
523+
}
524+
525+
def test_cluster_update_acl_null_addresses(self):
503526
cluster = LKECluster(self.client, 18881)
504527

505528
with self.mock_put("lke/clusters/18881/control_plane_acl") as m:

0 commit comments

Comments
 (0)