@@ -23,21 +23,24 @@ var _ = gc.Suite(&restrictedRootSuite{})
2323func (r * restrictedRootSuite ) SetUpTest (c * gc.C ) {
2424 r .BaseSuite .SetUpTest (c )
2525 r .root = apiserver .TestingRestrictedRoot (func (facade , method string ) error {
26- if facade == "Client" && method == "FullStatus" {
27- return errors .New ("blam" )
28- }
2926 return nil
3027 })
3128}
3229
3330func (r * restrictedRootSuite ) TestAllowedMethod (c * gc.C ) {
34- caller , err := r .root .FindMethod ("Client" , 6 , "WatchAll " )
31+ caller , err := r .root .FindMethod ("Client" , 8 , "FullStatus " )
3532 c .Check (err , jc .ErrorIsNil )
3633 c .Check (caller , gc .NotNil )
3734}
3835
3936func (r * restrictedRootSuite ) TestDisallowedMethod (c * gc.C ) {
40- caller , err := r .root .FindMethod ("Client" , 6 , "FullStatus" )
37+ r .root = apiserver .TestingRestrictedRoot (func (facade , method string ) error {
38+ if facade == "Client" && method == "FullStatus" {
39+ return errors .New ("blam" )
40+ }
41+ return nil
42+ })
43+ caller , err := r .root .FindMethod ("Client" , 8 , "FullStatus" )
4144 c .Assert (err , gc .ErrorMatches , "blam" )
4245 c .Assert (caller , gc .IsNil )
4346}
@@ -55,7 +58,7 @@ func (r *restrictedRootSuite) TestNonExistentFacade(c *gc.C) {
5558}
5659
5760func (r * restrictedRootSuite ) TestNonExistentMethod (c * gc.C ) {
58- caller , err := r .root .FindMethod ("Client" , 6 , "Bar" )
59- c .Assert (err , gc .ErrorMatches , `unknown method "Bar" at version 6 for facade type "Client"` )
61+ caller , err := r .root .FindMethod ("Client" , 8 , "Bar" )
62+ c .Assert (err , gc .ErrorMatches , `unknown method "Bar" at version 8 for facade type "Client"` )
6063 c .Assert (caller , gc .IsNil )
6164}
0 commit comments