MCPcopy
hub / github.com/purpleidea/mgmt / mkUser

Function mkUser

engine/resources/user_test.go:229–237  ·  view source on GitHub ↗

mkUser builds a *UserRes with name and state pre-set, plus any per-test tweaks applied by opts.

(name, state string, opts ...func(*UserRes))

Source from the content-addressed store, hash-verified

227// mkUser builds a *UserRes with name and state pre-set, plus any per-test
228// tweaks applied by opts.
229func mkUser(name, state string, opts ...func(*UserRes)) *UserRes {
230 r := &UserRes{State: state}
231 r.SetName(name)
232 r.SetKind("user")
233 for _, o := range opts {
234 o(r)
235 }
236 return r
237}
238
239func TestUserCheckApply_ExistsNoOp(t *testing.T) {
240 f := &fakeUserFuncs{}

Calls 2

SetNameMethod · 0.65
SetKindMethod · 0.65

Tested by

no test coverage detected