Skip to content

Commit cef0bbc

Browse files
committed
fix: cleanup tests dropping v6+v7 client facade
1 parent d4527d1 commit cef0bbc

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

api/connection_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (s *connectionSuite) apiConnection() api.Connection {
6767
},
6868
Facades: []params.FacadeVersions{{
6969
Name: "Client",
70-
Versions: []int{1, 2, 3, 4, 5, 6},
70+
Versions: []int{1, 2, 3, 4, 5, 6, 7, 8},
7171
}},
7272
}
7373

@@ -220,7 +220,7 @@ func (s *connectionSuite) TestBestFacadeVersion(c *gc.C) {
220220
apiConn := s.apiConnection()
221221
err := apiConn.Login(context.Background(), names.NewUserTag("admin"), jujutesting.AdminSecret, "", nil)
222222
c.Assert(err, jc.ErrorIsNil)
223-
c.Check(apiConn.BestFacadeVersion("Client"), gc.Equals, 6)
223+
c.Check(apiConn.BestFacadeVersion("Client"), gc.Equals, 8)
224224
}
225225

226226
func (s *connectionSuite) TestAPIHostPortsMovesConnectedValueFirst(c *gc.C) {

apiserver/admin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import (
5050
)
5151

5252
const (
53-
clientFacadeVersion = 6
53+
clientFacadeVersion = 8
5454
machineManagerFacadeVersion = 11
5555
sshClientFacadeVersion = 4
5656
pingerFacadeVersion = 1

apiserver/facadeversions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ func (s *facadeVersionSuite) TestClientSupport(c *gc.C) {
6464
}{
6565
{
6666
facadeName: "Client",
67-
summary: "Ensure that the Client facade supports 3.x for status requests",
68-
apiClientVersion: []int{6},
67+
summary: "Ensure that the Client facade supports 3.6+ for status requests",
68+
apiClientVersion: []int{8},
6969
},
7070
{
7171
facadeName: "ModelManager",

apiserver/restricted_root_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,24 @@ var _ = gc.Suite(&restrictedRootSuite{})
2323
func (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

3330
func (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

3936
func (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

5760
func (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

Comments
 (0)