Skip to content

Commit 1f0928f

Browse files
authored
Integration test (#696)
1 parent d4224ff commit 1f0928f

File tree

5 files changed

+63
-40
lines changed

5 files changed

+63
-40
lines changed

tests/integration/account/test_account.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ def test_account_transfer():
1717
assert_headers_in_lines(headers, lines)
1818

1919

20+
def test_available_service():
21+
res = (
22+
exec_test_command(
23+
BASE_CMD + ["get-availability", "--text", "--delimiter=,"]
24+
)
25+
.stdout.decode()
26+
.rstrip()
27+
)
28+
lines = res.splitlines()
29+
30+
headers = ["region", "unavailable"]
31+
assert_headers_in_lines(headers, lines)
32+
33+
2034
def test_region_availability():
2135
res = (
2236
exec_test_command(
@@ -91,6 +105,36 @@ def test_event_view(get_event_id):
91105
assert_headers_in_lines(headers, lines)
92106

93107

108+
def test_event_read(get_event_id):
109+
event_id = get_event_id
110+
process = exec_test_command(
111+
[
112+
"linode-cli",
113+
"events",
114+
"mark-read",
115+
event_id,
116+
"--text",
117+
"--delimiter=,",
118+
]
119+
)
120+
assert process.returncode == 0
121+
122+
123+
def test_event_seen(get_event_id):
124+
event_id = get_event_id
125+
process = exec_test_command(
126+
[
127+
"linode-cli",
128+
"events",
129+
"mark-seen",
130+
event_id,
131+
"--text",
132+
"--delimiter=,",
133+
]
134+
)
135+
assert process.returncode == 0
136+
137+
94138
def test_account_invoice_list():
95139
res = (
96140
exec_test_command(

tests/integration/linodes/test_configs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
@pytest.fixture(scope="session", autouse=True)
2727
def linode_instance_config_tests(linode_cloud_firewall):
28-
2928
linode_id = create_linode(
3029
firewall_id=linode_cloud_firewall,
3130
disk_encryption=False,

tests/integration/linodes/test_disk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
@pytest.fixture(scope="session", autouse=True)
2323
def linode_instance_disk_tests(linode_cloud_firewall):
24-
2524
linode_id = create_linode_and_wait(
2625
firewall_id=linode_cloud_firewall,
2726
disk_encryption=False,

tests/integration/lke/test_clusters.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -457,44 +457,6 @@ def test_node_pool(test_lke_cluster):
457457
yield node_pool_id
458458

459459

460-
def test_pool_view(test_lke_cluster, test_node_pool):
461-
cluster_id = test_lke_cluster
462-
463-
node_pool_id = test_node_pool
464-
465-
node_pool = (
466-
exec_test_command(
467-
BASE_CMD
468-
+ [
469-
"pool-view",
470-
cluster_id,
471-
node_pool_id,
472-
"--text",
473-
]
474-
)
475-
.stdout.decode()
476-
.rstrip()
477-
)
478-
479-
lines = node_pool.splitlines()
480-
481-
headers = [
482-
"autoscaler.enabled",
483-
"autoscaler.max",
484-
"autoscaler.min",
485-
"count",
486-
"disk_encryption",
487-
"id",
488-
"labels.key",
489-
"labels.value",
490-
"tags",
491-
"taints",
492-
"type",
493-
]
494-
495-
assert_headers_in_lines(headers, lines)
496-
497-
498460
def test_update_autoscaler(test_lke_cluster, test_node_pool):
499461
cluster_id = test_lke_cluster
500462
node_pool_id = test_node_pool

tests/integration/users/test_profile.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,22 @@ def test_profile_token_list():
116116
lines = res.splitlines()
117117
headers = ["label", "scopes", "token"]
118118
assert_headers_in_lines(headers, lines)
119+
120+
121+
def test_sshkeys_list():
122+
res = (
123+
exec_test_command(
124+
[
125+
"linode-cli",
126+
"sshkeys",
127+
"list",
128+
"--text",
129+
"--delimiter=,",
130+
]
131+
)
132+
.stdout.decode()
133+
.rstrip()
134+
)
135+
lines = res.splitlines()
136+
headers = ["label", "ssh_key"]
137+
assert_headers_in_lines(headers, lines)

0 commit comments

Comments
 (0)