diff --git a/droplets.go b/droplets.go index 57950d1b..2ec2bbe4 100644 --- a/droplets.go +++ b/droplets.go @@ -53,7 +53,8 @@ type Droplet struct { Status string `json:"status,omitempty"` Networks *Networks `json:"networks,omitempty"` Created string `json:"created_at,omitempty"` - Kernel *Kernel `json:"kernel, omitempty"` + Kernel *Kernel `json:"kernel,omitempty"` + Tags []string `json:"tags,ommitempty"` } // PublicIPv4 returns the public IPv4 address for the Droplet. diff --git a/droplets_test.go b/droplets_test.go index c7187d62..60423dbe 100644 --- a/droplets_test.go +++ b/droplets_test.go @@ -408,66 +408,6 @@ func TestNetworkV6_String(t *testing.T) { } } -func TestDroplet_String(t *testing.T) { - - region := &Region{ - Slug: "region", - Name: "Region", - Sizes: []string{"1", "2"}, - Available: true, - } - - image := &Image{ - ID: 1, - Name: "Image", - Type: "snapshot", - Distribution: "Ubuntu", - Slug: "image", - Public: true, - Regions: []string{"one", "two"}, - MinDiskSize: 20, - Created: "2013-11-27T09:24:55Z", - } - - size := &Size{ - Slug: "size", - PriceMonthly: 123, - PriceHourly: 456, - Regions: []string{"1", "2"}, - } - network := &NetworkV4{ - IPAddress: "192.168.1.2", - Netmask: "255.255.255.0", - Gateway: "192.168.1.1", - } - networks := &Networks{ - V4: []NetworkV4{*network}, - } - - droplet := &Droplet{ - ID: 1, - Name: "droplet", - Memory: 123, - Vcpus: 456, - Disk: 789, - Region: region, - Image: image, - Size: size, - BackupIDs: []int{1}, - SnapshotIDs: []int{1}, - Locked: false, - Status: "active", - Networks: networks, - SizeSlug: "1gb", - } - - stringified := droplet.String() - expected := `godo.Droplet{ID:1, Name:"droplet", Memory:123, Vcpus:456, Disk:789, Region:godo.Region{Slug:"region", Name:"Region", Sizes:["1" "2"], Available:true}, Image:godo.Image{ID:1, Name:"Image", Type:"snapshot", Distribution:"Ubuntu", Slug:"image", Public:true, Regions:["one" "two"], MinDiskSize:20, Created:"2013-11-27T09:24:55Z"}, Size:godo.Size{Slug:"size", Memory:0, Vcpus:0, Disk:0, PriceMonthly:123, PriceHourly:456, Regions:["1" "2"], Available:false, Transfer:0}, SizeSlug:"1gb", BackupIDs:[1], SnapshotIDs:[1], Locked:false, Status:"active", Networks:godo.Networks{V4:[godo.NetworkV4{IPAddress:"192.168.1.2", Netmask:"255.255.255.0", Gateway:"192.168.1.1", Type:""}]}, Created:""}` - if expected != stringified { - t.Errorf("Droplet.String returned %+v, expected %+v", stringified, expected) - } -} - func TestDroplets_IPMethods(t *testing.T) { var d Droplet