Skip to content

Commit 8985109

Browse files
authored
Change assignments type from dict to list (#687)
1 parent bf13f2e commit 8985109

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

linode_api4/groups/networking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ def ip_addresses_assign(self, assignments, region):
452452
:param assignments: Any number of assignments to make. See
453453
:any:`IPAddress.to` for details on how to construct
454454
assignments.
455-
:type assignments: dct
455+
:type assignments: list
456456
"""
457457

458-
for a in assignments["assignments"]:
458+
for a in assignments:
459459
if not "address" in a or not "linode_id" in a:
460460
raise ValueError("Invalid assignment: {}".format(a))
461461

test/unit/linode_client_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,13 +1407,13 @@ def test_ip_addresses_assign(self):
14071407

14081408
with self.mock_post({}) as m:
14091409
self.client.networking.ip_addresses_assign(
1410-
{"assignments": [{"address": "192.0.2.1", "linode_id": 123}]},
1410+
[{"address": "192.0.2.1", "linode_id": 123}],
14111411
"us-east",
14121412
)
14131413
self.assertEqual(m.call_url, "/networking/ips/assign")
14141414
self.assertEqual(
14151415
m.call_data["assignments"],
1416-
{"assignments": [{"address": "192.0.2.1", "linode_id": 123}]},
1416+
[{"address": "192.0.2.1", "linode_id": 123}],
14171417
)
14181418
self.assertEqual(m.call_data["region"], "us-east")
14191419

0 commit comments

Comments
 (0)