From 1f08f74cced26ffb9b7dab0dd37a7e07de9ceae3 Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Tue, 18 Dec 2018 00:33:32 -0800 Subject: [PATCH] add test for updating non-existent labels --- testing/label_service.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/testing/label_service.go b/testing/label_service.go index a321016ba0..faa2e71a47 100644 --- a/testing/label_service.go +++ b/testing/label_service.go @@ -352,6 +352,28 @@ func UpdateLabel( }, }, }, + { + name: "updating a non-existent label", + fields: LabelFields{ + Labels: []*platform.Label{}, + }, + args: args{ + label: platform.Label{ + ResourceID: MustIDBase16(bucketOneID), + Name: "Tag1", + }, + update: platform.LabelUpdate{ + Color: &validColor, + }, + }, + wants: wants{ + labels: []*platform.Label{}, + err: &platform.Error{ + Code: platform.ENotFound, + Op: platform.OpUpdateLabel, + }, + }, + }, } for _, tt := range tests {