Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63b3b98

Browse files
Remove ErrorsWithPG function and replace with Errors
Since we removed the in-memory database, ErrorsWithPG is nowidentical to Errors. This removes:- The ErrorsWithPG function definition from setup_test.go- Replaces the single usage of ErrorsWithPG with ErrorsCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
1 parent0944bf7 commit63b3b98

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

‎coderd/database/dbauthz/dbauthz_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
31203120
}))
31213121
s.Run("GetAppSecurityKey",s.Mocked(func(dbm*dbmock.MockStore,_*gofakeit.Faker,check*expects) {
31223122
dbm.EXPECT().GetAppSecurityKey(gomock.Any()).Return("",sql.ErrNoRows).AnyTimes()
3123-
check.Args().Asserts(rbac.ResourceSystem,policy.ActionRead).ErrorsWithPG(sql.ErrNoRows)
3123+
check.Args().Asserts(rbac.ResourceSystem,policy.ActionRead).Errors(sql.ErrNoRows)
31243124
}))
31253125
s.Run("UpsertAppSecurityKey",s.Mocked(func(dbm*dbmock.MockStore,_*gofakeit.Faker,check*expects) {
31263126
dbm.EXPECT().UpsertAppSecurityKey(gomock.Any(),"foo").Return(nil).AnyTimes()

‎coderd/database/dbauthz/setup_test.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,6 @@ func (m *expects) Errors(err error) *expects {
430430
returnm
431431
}
432432

433-
// ErrorsWithPG is optional. If it is never called, it will not be asserted.
434-
// Since we removed the in-memory database, this is now equivalent to Errors.
435-
func (m*expects)ErrorsWithPG(errerror)*expects {
436-
returnm.Errors(err)
437-
}
438-
439433
func (m*expects)FailSystemObjectChecks()*expects {
440434
returnm.WithSuccessAuthorizer(func(ctx context.Context,subject rbac.Subject,action policy.Action,obj rbac.Object)error {
441435
ifobj.Type==rbac.ResourceSystem.Type {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp