Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 } |
LEFT | RIGHT |