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

Delta Between Two Patch Sets: testservices/errors_test.go

Issue 99960043: Added proper errortype in testservices.
Left Patch Set: Created 9 years, 11 months ago
Right Patch Set: Added proper errortype in testservices. Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « testservices/errors.go ('k') | testservices/novaservice/service.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package testservices 1 package testservices
2 2
3 import ( 3 import (
4 gc "launchpad.net/gocheck" 4 gc "launchpad.net/gocheck"
5 "testing" 5 "testing"
6 ) 6 )
7 7
8 func Test(t *testing.T) { gc.TestingT(t) } 8 func Test(t *testing.T) { gc.TestingT(t) }
9 9
10 type ErrorsSuite struct { 10 type ErrorsSuite struct {
11 } 11 }
12 12
13 var _ = gc.Suite(&ErrorsSuite{}) 13 var _ = gc.Suite(&ErrorsSuite{})
14 14
15 func (s *ErrorsSuite) TestServerErrorMessage(c *gc.C) { 15 func (s *ErrorsSuite) TestServerErrorMessage(c *gc.C) {
16 err := &ServerError{ 16 err := &ServerError{
17 message: "Instance could not be found", 17 message: "Instance could not be found",
18 code: 404, 18 code: 404,
19 } 19 }
20 // _, ok := err.(*error)
axw 2014/04/30 21:40:00 delete me
21 // c.Assert(ok, gc.Equals, true)
22 c.Assert(err, gc.ErrorMatches, "itemNotFound: Instance could not be foun d") 20 c.Assert(err, gc.ErrorMatches, "itemNotFound: Instance could not be foun d")
23 } 21 }
24 22
25 func (s *ErrorsSuite) TestServerUnknownErrcode(c *gc.C) { 23 func (s *ErrorsSuite) TestServerUnknownErrcode(c *gc.C) {
26 err := &ServerError{ 24 err := &ServerError{
27 message: "Impossible http code.", 25 message: "Impossible http code.",
28 code: 999, 26 code: 999,
29 } 27 }
30 // _, ok := err.(*error)
axw 2014/04/30 21:40:00 delete me
31 // c.Assert(ok, gc.Equals, true)
32 c.Assert(err, gc.ErrorMatches, "computeFault: Impossible http code.") 28 c.Assert(err, gc.ErrorMatches, "computeFault: Impossible http code.")
33 } 29 }
LEFTRIGHT

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