Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(104)

Unified Diff: state/apiserver/common/setstatus_test.go

Issue 62230043: state/..., worker/..., utils/...: use errgo
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/apiserver/common/setstatus.go ('k') | state/apiserver/common/tools.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: state/apiserver/common/setstatus_test.go
=== modified file 'state/apiserver/common/setstatus_test.go'
--- state/apiserver/common/setstatus_test.go 2014-01-20 21:29:08 +0000
+++ state/apiserver/common/setstatus_test.go 2014-02-10 21:28:38 +0000
@@ -4,8 +4,7 @@
package common_test
import (
- "fmt"
-
+ "launchpad.net/errgo/errors"
gc "launchpad.net/gocheck"
"launchpad.net/juju-core/state"
@@ -37,7 +36,7 @@
func (*statusSetterSuite) TestSetStatus(c *gc.C) {
st := &fakeState{
entities: map[string]entityWithError{
- "x0": &fakeStatusSetter{status: params.StatusPending, info: "blah", err: fmt.Errorf("x0 fails")},
+ "x0": &fakeStatusSetter{status: params.StatusPending, info: "blah", err: errors.Newf("x0 fails")},
"x1": &fakeStatusSetter{status: params.StatusStarted, info: "foo"},
"x2": &fakeStatusSetter{status: params.StatusError, info: "some info"},
"x3": &fakeStatusSetter{fetchError: "x3 error"},
@@ -87,7 +86,7 @@
func (*statusSetterSuite) TestSetStatusError(c *gc.C) {
getCanModify := func() (common.AuthFunc, error) {
- return nil, fmt.Errorf("pow")
+ return nil, errors.Newf("pow")
}
s := common.NewStatusSetter(&fakeState{}, getCanModify)
args := params.SetStatus{
@@ -99,7 +98,7 @@
func (*statusSetterSuite) TestSetStatusNoArgsNoError(c *gc.C) {
getCanModify := func() (common.AuthFunc, error) {
- return nil, fmt.Errorf("pow")
+ return nil, errors.Newf("pow")
}
s := common.NewStatusSetter(&fakeState{}, getCanModify)
result, err := s.SetStatus(params.SetStatus{})
« no previous file with comments | « state/apiserver/common/setstatus.go ('k') | state/apiserver/common/tools.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b