MCPcopy Create free account
hub / github.com/belak/gitdir / TestLookupUserFromUsername

Function TestLookupUserFromUsername

user_test.go:12–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestLookupUserFromUsername(t *testing.T) {
13 t.Parallel()
14
15 c := newTestConfig()
16
17 var tests = []struct { //nolint:gofumpt
18 Username string
19 Error error
20 }{
21 {
22 "missing-user",
23 ErrUserNotFound,
24 },
25 {
26 "disabled",
27 ErrUserNotFound,
28 },
29 }
30
31 for _, test := range tests {
32 user, err := c.LookupUserFromUsername(test.Username)
33
34 if test.Error != nil {
35 require.Equal(t, test.Error, err)
36 } else {
37 assert.Nil(t, err)
38 assert.Equal(t, test.Username, user.Username)
39 }
40 }
41}
42
43func TestLookupUserFromKey(t *testing.T) { //nolint:funlen
44 t.Parallel()

Callers

nothing calls this directly

Calls 2

newTestConfigFunction · 0.85

Tested by

no test coverage detected