Skip to content

Commit

Permalink
test: update primary ip create tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Feb 19, 2024
1 parent 5704469 commit 8252f5c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/unit/primary_ips/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,10 @@ def test_create_with_datacenter(self, primary_ips_client, primary_ip_response):
url="/primary_ips",
method="POST",
json={
"name": "my-resource",
"type": "ipv6",
"name": "my-resource",
"datacenter": "datacenter",
"auto_delete": False,
"assignee_type": "server",
},
)

Expand All @@ -179,20 +178,18 @@ def test_create_with_assignee_id(
response = primary_ips_client.create(
type="ipv6",
name="my-ip",
assignee_id=1,
assignee_type="server",
datacenter=Datacenter(name="datacenter"),
assignee_id=17,
auto_delete=True,
)
primary_ips_client._client.request.assert_called_with(
url="/primary_ips",
method="POST",
json={
"type": "ipv6",
"assignee_id": 1,
"assignee_type": "server",
"name": "my-ip",
"auto_delete": False,
"datacenter": "datacenter",
"assignee_id": 17,
"assignee_type": "server",
"auto_delete": True,
},
)
bound_primary_ip = response.primary_ip
Expand All @@ -202,6 +199,7 @@ def test_create_with_assignee_id(
assert bound_primary_ip.id == 42
assert bound_primary_ip.name == "my-ip"
assert bound_primary_ip.assignee_id == 17
assert bound_primary_ip.auto_delete is True
assert action.id == 13

@pytest.mark.parametrize(
Expand Down

0 comments on commit 8252f5c

Please sign in to comment.