MCPcopy Index your code
hub / github.com/coder/coder / TestPing

Function TestPing

coderd/database/dbauthz/dbauthz_test.go:76–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestPing(t *testing.T) {
77 t.Parallel()
78
79 db := dbmock.NewMockStore(gomock.NewController(t))
80 db.EXPECT().Wrappers().Times(1).Return([]string{})
81 db.EXPECT().Ping(gomock.Any()).Times(1).Return(time.Second, nil)
82 q := dbauthz.New(db, &coderdtest.RecordingAuthorizer{}, slog.Make(), coderdtest.AccessControlStorePointer())
83 _, err := q.Ping(context.Background())
84 require.NoError(t, err, "must not error")
85}
86
87// TestInTX is not perfect, just checks that it properly checks auth.
88func TestInTX(t *testing.T) {

Callers

nothing calls this directly

Calls 6

EXPECTMethod · 0.95
NewMockStoreFunction · 0.92
NewFunction · 0.92
WrappersMethod · 0.65
PingMethod · 0.65

Tested by

no test coverage detected