(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestSetPermissions(t *testing.T) { |
| 9 | t.Parallel() |
| 10 | permsExt := map[string]string{ |
| 11 | "foo": "bar", |
| 12 | } |
| 13 | session, _, cleanup := newTestSessionWithOptions(t, &Server{ |
| 14 | Handler: func(s Session) { |
| 15 | if _, ok := s.Permissions().Extensions["foo"]; !ok { |
| 16 | t.Fatalf("got %#v; want %#v", s.Permissions().Extensions, permsExt) |
| 17 | } |
| 18 | }, |
| 19 | }, nil, PasswordAuth(func(ctx Context, password string) bool { |
| 20 | ctx.Permissions().Extensions = permsExt |
| 21 | return true |
| 22 | })) |
| 23 | defer cleanup() |
| 24 | if err := session.Run(""); err != nil { |
| 25 | t.Fatal(err) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestSetValue(t *testing.T) { |
| 30 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…