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

Method SetupSuite

coderd/database/dbauthz/setup_test.go:70–89  ·  view source on GitHub ↗

SetupSuite sets up the suite by creating a map of all methods on querier and setting their count to 0.

()

Source from the content-addressed store, hash-verified

68// SetupSuite sets up the suite by creating a map of all methods on querier
69// and setting their count to 0.
70func (s *MethodTestSuite) SetupSuite() {
71 ctrl := gomock.NewController(s.T())
72 mockStore := dbmock.NewMockStore(ctrl)
73 // We intentionally set no expectations apart from this.
74 mockStore.EXPECT().Wrappers().Return([]string{}).AnyTimes()
75 az := dbauthz.New(mockStore, nil, slog.Make(), coderdtest.AccessControlStorePointer())
76 // Take the underlying type of the interface.
77 azt := reflect.TypeOf(az)
78 require.Greater(s.T(), azt.NumMethod(), 0, "no methods found on querier")
79 s.methodAccounting = make(map[string]int)
80 for i := 0; i < azt.NumMethod(); i++ {
81 method := azt.Method(i)
82 if _, ok := skipMethods[method.Name]; ok {
83 // We can't use s.T().Skip as this will skip the entire suite.
84 s.T().Logf("Skipping method %q: %s", method.Name, skipMethods[method.Name])
85 continue
86 }
87 s.methodAccounting[method.Name] = 0
88 }
89}
90
91// TearDownSuite asserts that all methods were called at least once.
92func (s *MethodTestSuite) TearDownSuite() {

Callers

nothing calls this directly

Calls 7

EXPECTMethod · 0.95
NewMockStoreFunction · 0.92
NewFunction · 0.92
WrappersMethod · 0.65
LogfMethod · 0.65
MethodMethod · 0.45

Tested by

no test coverage detected