Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Dec 19, 2024
1 parent 8b887c6 commit fcdd733
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
17 changes: 9 additions & 8 deletions internal/cmd/network/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ func TestCreateJSON(t *testing.T) {
Labels: make(map[string]string),
}).
Return(&hcloud.Network{
ID: 123,
Name: "myNetwork",
IPRange: ipRange,
Created: time.Date(2016, 1, 30, 23, 50, 0, 0, time.UTC),
Labels: make(map[string]string),
Servers: []*hcloud.Server{{ID: 1}, {ID: 2}, {ID: 3}},
Routes: []hcloud.NetworkRoute{},
Subnets: []hcloud.NetworkSubnet{},
ID: 123,
Name: "myNetwork",
IPRange: ipRange,
Created: time.Date(2016, 1, 30, 23, 50, 0, 0, time.UTC),
Labels: make(map[string]string),
Servers: []*hcloud.Server{{ID: 1}, {ID: 2}, {ID: 3}},
LoadBalancers: []*hcloud.LoadBalancer{{ID: 4}, {ID: 5}, {ID: 6}},
Routes: []hcloud.NetworkRoute{},
Subnets: []hcloud.NetworkSubnet{},
}, nil, nil)

jsonOut, out, err := fx.Run(cmd, []string{"-o=json", "--name", "myNetwork", "--ip-range", "10.0.0.0/24"})
Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/network/testdata/create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"id": 123,
"ip_range": "10.0.0.0/24",
"labels": {},
"load_balancers": [
4,
5,
6
],
"name": "myNetwork",
"protection": {
"delete": false
Expand Down
1 change: 1 addition & 0 deletions test/e2e/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func TestNetwork(t *testing.T) {
"gateway": "10.0.0.1"
}
],
"load_balancers": [],
"routes": [
{
"destination": "10.100.1.0/24",
Expand Down

0 comments on commit fcdd733

Please sign in to comment.