Skip to content

Commit 5a48677

Browse files
committed
address pr comment
1 parent ba5f96a commit 5a48677

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

tests/integration/firewalls/test_firewalls.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import pytest
6+
from pytest import MonkeyPatch
67

78
from linodecli.exit_codes import ExitCodes
89
from tests.integration.helpers import (
@@ -290,7 +291,8 @@ def test_firewall_settings_update_and_list(test_firewall_id):
290291
assert firewall_ids[key] == int(test_firewall_id)
291292

292293

293-
def test_firewall_templates_list():
294+
def test_firewall_templates_list(monkeypatch: MonkeyPatch):
295+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
294296
data = json.loads(
295297
exec_test_command(BASE_CMD + ["templates-list", "--json"])
296298
.stdout.decode()
@@ -318,7 +320,8 @@ def test_firewall_templates_list():
318320
assert "addresses" in rule
319321

320322

321-
def test_firewall_template_view():
323+
def test_firewall_template_view(monkeypatch: MonkeyPatch):
324+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
322325
for slug in ["akamai-non-prod", "vpc", "public"]:
323326
data = json.loads(
324327
exec_test_command(BASE_CMD + ["template-view", slug, "--json"])

tests/integration/linodes/test_linode_interfaces.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22

33
import pytest
4+
from pytest import MonkeyPatch
45

56
from tests.integration.helpers import (
67
delete_target_id,
@@ -43,7 +44,7 @@ def linode_interface_vlan(linode_cloud_firewall):
4344

4445
yield linode_id
4546

46-
# delete_target_id(target="linodes", id=linode_id)
47+
delete_target_id(target="linodes", id=linode_id)
4748

4849

4950
@pytest.fixture(scope="session")
@@ -143,7 +144,8 @@ def get_ipv4_addr(linode_id: "str"):
143144
return str(ipv4_addr)
144145

145146

146-
def test_interface_add(linode_cloud_firewall):
147+
def test_interface_add(linode_cloud_firewall, monkeypatch: MonkeyPatch):
148+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
147149
linode_id = create_linode(
148150
firewall_id=linode_cloud_firewall,
149151
test_region="us-sea",
@@ -214,9 +216,10 @@ def test_interface_add(linode_cloud_firewall):
214216
delete_target_id(target="linodes", id=linode_id)
215217

216218

217-
def test_interface_firewalls_list(linode_interface_public):
218-
linode_id = linode_interface_public
219+
def test_interface_firewalls_list(linode_interface_public, monkeypatch: MonkeyPatch):
220+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
219221

222+
linode_id = linode_interface_public
220223
interface_id = get_interface_id(linode_id)
221224

222225
data = json.loads(
@@ -247,9 +250,10 @@ def test_interface_firewalls_list(linode_interface_public):
247250
assert "rules" in firewall and isinstance(firewall["rules"], dict)
248251

249252

250-
def test_interface_settings_update(linode_interface_public):
251-
linode_id = linode_interface_public
253+
def test_interface_settings_update(linode_interface_public, monkeypatch: MonkeyPatch):
254+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
252255

256+
linode_id = linode_interface_public
253257
interface_id = get_interface_id(linode_id)
254258

255259
data = json.loads(
@@ -286,7 +290,9 @@ def test_interface_settings_update(linode_interface_public):
286290
assert default_route["ipv6_eligible_interface_ids"] == [int(interface_id)]
287291

288292

289-
def test_interface_update(linode_interface_public):
293+
def test_interface_update(linode_interface_public, monkeypatch: MonkeyPatch):
294+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
295+
290296
linode_id = linode_interface_public
291297
interface_id = get_interface_id(linode_id)
292298
ipv4_addr = get_ipv4_addr(linode_id)
@@ -340,9 +346,10 @@ def test_interface_update(linode_interface_public):
340346
assert all("range" in r and r["range"].endswith("/64") for r in ipv6_ranges)
341347

342348

343-
def test_interface_view(linode_interface_vpc):
344-
linode_id = linode_interface_vpc
349+
def test_interface_view(linode_interface_vpc, monkeypatch: MonkeyPatch):
350+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
345351

352+
linode_id = linode_interface_vpc
346353
interface_id = get_interface_id(linode_id)
347354

348355
data = json.loads(
@@ -379,7 +386,8 @@ def test_interface_view(linode_interface_vpc):
379386
)
380387

381388

382-
def test_interfaces_list(linode_interface_vlan):
389+
def test_interfaces_list(linode_interface_vlan, monkeypatch: MonkeyPatch):
390+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
383391
linode_id = linode_interface_vlan
384392

385393
data = json.loads(
@@ -418,7 +426,9 @@ def test_interfaces_list(linode_interface_vlan):
418426

419427

420428
@pytest.mark.flaky(reruns=3, reruns_delay=2)
421-
def test_interfaces_upgrade(linode_interface_legacy):
429+
def test_interfaces_upgrade(linode_interface_legacy, monkeypatch: MonkeyPatch):
430+
monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta")
431+
422432
linode_id = linode_interface_legacy
423433

424434
# wait boot/provisioning

0 commit comments

Comments
 (0)