Skip to content

Commit 71bdfa1

Browse files
authored
Add unit test coverage for VPC related methods/functions (#673)
* vpc_tests * update_testname * fix * fix_format
1 parent 33c0c1d commit 71bdfa1

13 files changed

+418
-0
lines changed

test/unit/fixtures/vpc_create.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"id": 123,
3+
"label": "test-vpc",
4+
"description": "Test VPC description",
5+
"region": "us-east",
6+
"subnets": [
7+
{
8+
"id": 1,
9+
"label": "subnet-1",
10+
"region": "us-east"
11+
},
12+
{
13+
"id": 2,
14+
"label": "subnet-2",
15+
"region": "us-east"
16+
}
17+
],
18+
"created": "2023-01-01T12:00:00",
19+
"updated": "2023-01-02T12:00:00"
20+
}
21+

test/unit/fixtures/vpc_get.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": 123,
3+
"label": "test-vpc",
4+
"description": "Test VPC description",
5+
"region": "us-east",
6+
"subnets": [],
7+
"created": "2023-01-01T12:00:00",
8+
"updated": "2023-01-02T12:00:00"
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"data": [
3+
{
4+
"address": "192.168.1.10",
5+
"vpc_id": 123
6+
},
7+
{
8+
"address": "192.168.1.11",
9+
"vpc_id": 124
10+
}
11+
],
12+
"page": 1,
13+
"pages": 1,
14+
"results": 2
15+
}

test/unit/fixtures/vpc_list.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"data": [
3+
{
4+
"id": 123,
5+
"label": "test-vpc",
6+
"description": "Test VPC description",
7+
"region": "us-east",
8+
"subnets": [
9+
{
10+
"id": 456,
11+
"label": "subnet-1",
12+
"ipv4": "192.168.1.0/24",
13+
"linodes": []
14+
}
15+
]
16+
}
17+
],
18+
"page": 1,
19+
"pages": 1,
20+
"results": 1
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"data": [
3+
{
4+
"address": "192.168.1.20",
5+
"vpc_id": 123
6+
},
7+
{
8+
"address": "192.168.1.21",
9+
"vpc_id": 123
10+
}
11+
],
12+
"page": 1,
13+
"pages": 1,
14+
"results": 2
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": 789,
3+
"label": "Test Subnet",
4+
"ipv4": "192.168.1.0/24",
5+
"linodes": [],
6+
"created": "2025-01-01T12:00:00",
7+
"updated": "2025-01-01T12:00:00"
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": 456,
3+
"label": "Existing Subnet",
4+
"ipv4": "192.168.2.0/24",
5+
"linodes": [
6+
{
7+
"id": 101,
8+
"interfaces": [
9+
{
10+
"id": 1,
11+
"active": true
12+
},
13+
{
14+
"id": 2,
15+
"active": false
16+
}
17+
]
18+
}
19+
],
20+
"created": "2025-01-01T10:00:00",
21+
"updated": "2025-01-02T10:00:00"
22+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": 456,
3+
"label": "Updated Subnet",
4+
"ipv4": "192.168.2.0/24",
5+
"linodes": [],
6+
"created": "2025-01-01T10:00:00",
7+
"updated": "2025-02-01T10:00:00"
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"data": [
3+
{
4+
"id": 123,
5+
"label": "Subnet A",
6+
"ipv4": "192.168.3.0/24"
7+
},
8+
{
9+
"id": 124,
10+
"label": "Subnet B",
11+
"ipv4": "192.168.4.0/24"
12+
}
13+
],
14+
"page": 1,
15+
"pages": 1
16+
}
17+

test/unit/fixtures/vpc_update.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": 123,
3+
"label": "updated-vpc",
4+
"description": "Updated description",
5+
"region": "us-east",
6+
"subnets": [],
7+
"created": "2023-01-01T12:00:00",
8+
"updated": "2023-01-02T12:00:00"
9+
}

0 commit comments

Comments
 (0)