Skip to content

Commit

Permalink
Merge pull request digitalocean#93 from shawnps/patch-1
Browse files Browse the repository at this point in the history
use Errorf
  • Loading branch information
bryanl authored Jul 18, 2016
2 parents 25f12cd + 0111175 commit 27d2cca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestTags_List(t *testing.T) {

tags, _, err := client.Tags.List(nil)
if err != nil {
t.Error("Tags.List returned error: %v", err)
t.Errorf("Tags.List returned error: %v", err)
}

expected := []Tag{{Name: "testing-1", Resources: &TaggedResources{Droplets: &TaggedDropletsResources{Count: 0, LastTagged: nil}}},
Expand All @@ -196,7 +196,7 @@ func TestTags_ListEmpty(t *testing.T) {

tags, _, err := client.Tags.List(nil)
if err != nil {
t.Error("Tags.List returned error: %v", err)
t.Errorf("Tags.List returned error: %v", err)
}

expected := []Tag{}
Expand All @@ -216,7 +216,7 @@ func TestTags_ListPaging(t *testing.T) {

_, resp, err := client.Tags.List(nil)
if err != nil {
t.Error("Tags.List returned error: %v", err)
t.Errorf("Tags.List returned error: %v", err)
}
checkCurrentPage(t, resp, 2)
}
Expand All @@ -232,19 +232,19 @@ func TestTags_Get(t *testing.T) {

tag, _, err := client.Tags.Get("testing-1")
if err != nil {
t.Error("Tags.Get returned error: %v", err)
t.Errorf("Tags.Get returned error: %v", err)
}

if tag.Name != "testing-1" {
t.Error("Tags.Get return an incorrect name, got %+v, expected %+v", tag.Name, "testing-1")
t.Errorf("Tags.Get return an incorrect name, got %+v, expected %+v", tag.Name, "testing-1")
}

if tag.Resources.Droplets.Count != 1 {
t.Error("Tags.Get return an incorrect droplet resource count, got %+v, expected %+v", tag.Resources.Droplets.Count, 1)
t.Errorf("Tags.Get return an incorrect droplet resource count, got %+v, expected %+v", tag.Resources.Droplets.Count, 1)
}

if tag.Resources.Droplets.LastTagged.ID != 1 {
t.Error("Tags.Get return an incorrect last tagged droplet %+v, expected %+v", tag.Resources.Droplets.LastTagged.ID, 1)
t.Errorf("Tags.Get return an incorrect last tagged droplet %+v, expected %+v", tag.Resources.Droplets.LastTagged.ID, 1)
}
}

Expand Down

0 comments on commit 27d2cca

Please sign in to comment.