@@ -136,8 +136,8 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *Metho
136
136
if len (testCase .Assertions ) > 0 {
137
137
// Only run these tests if we know the underlying call makes
138
138
// rbac assertions.
139
- s .TestNotAuthorized (ctx , fakeAuthorizer , callMethod )
140
- s .TestNoActor (callMethod )
139
+ s .NotAuthorizedErrorTest (ctx , fakeAuthorizer , callMethod )
140
+ s .NoActorErrorTest (callMethod )
141
141
}
142
142
143
143
// Always run
@@ -180,17 +180,17 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *Metho
180
180
}
181
181
}
182
182
183
- func (s * MethodTestSuite ) TestNoActor (callMethod func (ctx context.Context ) ([]reflect.Value , error )) {
183
+ func (s * MethodTestSuite ) NoActorErrorTest (callMethod func (ctx context.Context ) ([]reflect.Value , error )) {
184
184
s .Run ("NoActor" , func () {
185
185
// Call without any actor
186
186
_ , err := callMethod (context .Background ())
187
187
s .ErrorIs (err , authzquery .NoActorError , "method should return NoActorError error when no actor is provided" )
188
188
})
189
189
}
190
190
191
- // TestNotAuthorized runs the given method with an authorizer that will fail authz.
191
+ // NotAuthorizedErrorTest runs the given method with an authorizer that will fail authz.
192
192
// Asserts that the error returned is a NotAuthorizedError.
193
- func (s * MethodTestSuite ) TestNotAuthorized (ctx context.Context , az * coderdtest.FakeAuthorizer , callMethod func (ctx context.Context ) ([]reflect.Value , error )) {
193
+ func (s * MethodTestSuite ) NotAuthorizedErrorTest (ctx context.Context , az * coderdtest.FakeAuthorizer , callMethod func (ctx context.Context ) ([]reflect.Value , error )) {
194
194
s .Run ("NotAuthorized" , func () {
195
195
az .AlwaysReturn = xerrors .New ("Always fail authz" )
196
196
@@ -302,8 +302,8 @@ MethodLoop:
302
302
if len (testCase .Assertions ) > 0 {
303
303
// Only run these tests if we know the underlying call makes
304
304
// rbac assertions.
305
- s .TestNotAuthorized (ctx , fakeAuthorizer , callMethod )
306
- s .TestNoActor (callMethod )
305
+ s .NotAuthorizedErrorTest (ctx , fakeAuthorizer , callMethod )
306
+ s .NoActorErrorTest (callMethod )
307
307
}
308
308
309
309
// Always run
0 commit comments