(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestFileStoreErase(t *testing.T) { |
| 183 | f := &fakeStore{configs: map[string]types.AuthConfig{ |
| 184 | "https://example.com": { |
| 185 | Username: "foo@example.com", |
| 186 | Auth: "super_secret_token", |
| 187 | ServerAddress: "https://example.com", |
| 188 | }, |
| 189 | }} |
| 190 | |
| 191 | s := NewFileStore(f) |
| 192 | err := s.Erase("https://example.com") |
| 193 | if err != nil { |
| 194 | t.Fatal(err) |
| 195 | } |
| 196 | |
| 197 | // file store never returns errors, check that the auth config is empty |
| 198 | a, err := s.Get("https://example.com") |
| 199 | if err != nil { |
| 200 | t.Fatal(err) |
| 201 | } |
| 202 | |
| 203 | if a.Auth != "" { |
| 204 | t.Fatalf("expected empty auth token, got %s", a.Auth) |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | func TestConvertToHostname(t *testing.T) { |
| 209 | tests := []struct{ input, expected string }{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…