(t *testing.T)
| 72 | } |
| 73 | |
| 74 | func (s) TestAuthInfoFromPeer(t *testing.T) { |
| 75 | altsAuthInfo := &fakeALTSAuthInfo{} |
| 76 | p := &peer.Peer{ |
| 77 | AuthInfo: altsAuthInfo, |
| 78 | } |
| 79 | for _, tc := range []struct { |
| 80 | desc string |
| 81 | p *peer.Peer |
| 82 | success bool |
| 83 | out AuthInfo |
| 84 | }{ |
| 85 | { |
| 86 | "working case", |
| 87 | p, |
| 88 | true, |
| 89 | altsAuthInfo, |
| 90 | }, |
| 91 | } { |
| 92 | authInfo, err := AuthInfoFromPeer(tc.p) |
| 93 | if got, want := (err == nil), tc.success; got != want { |
| 94 | t.Errorf("%v: AuthInfoFromPeer(_)=(err=nil)=%v, want %v", tc.desc, got, want) |
| 95 | } |
| 96 | if got, want := authInfo, tc.out; got != want { |
| 97 | t.Errorf("%v:, AuthInfoFromPeer(_)=(%v, _), want (%v, _)", tc.desc, got, want) |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func (s) TestClientAuthorizationCheck(t *testing.T) { |
| 103 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
nothing calls this directly
no test coverage detected