| "github.com/rackspace/gophercloud" |
| th "github.com/rackspace/gophercloud/testhelper" |
| func TestHostRoute(t *testing.T) { |
| "network_id": "3e66c41e-cbbd-4019-9aab-740b7e4150a0", |
| "tenant_id": "f86e123198cf42d19c8854c5f80c2f06", |
| "gateway_ip": "172.16.0.1", |
| "destination": "172.20.1.0/24", |
| "ipv6_address_mode": null, |
| "id": "6dcaa873-7115-41af-9ef5-915f73636e43", |
| err := json.Unmarshal(sejson, &dejson) |
| resp := commonResult{gophercloud.Result{Body: dejson}} |
| subnet, err := resp.Extract() |
| route := subnet.HostRoutes[0] |
| th.AssertEquals(t, route.NextHop, "172.16.0.2") |
| th.AssertEquals(t, route.DestinationCIDR, "172.20.1.0/24") |