(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestFileStoreAddCredentials(t *testing.T) { |
| 105 | f := &fakeStore{configs: map[string]types.AuthConfig{}} |
| 106 | |
| 107 | s := NewFileStore(f) |
| 108 | auth := types.AuthConfig{ |
| 109 | Username: "foo@example.com", |
| 110 | Auth: "super_secret_token", |
| 111 | ServerAddress: "https://example.com", |
| 112 | } |
| 113 | err := s.Store(auth) |
| 114 | assert.NilError(t, err) |
| 115 | assert.Check(t, is.Len(f.GetAuthConfigs(), 1)) |
| 116 | |
| 117 | actual, ok := f.GetAuthConfigs()["https://example.com"] |
| 118 | assert.Check(t, ok) |
| 119 | assert.Check(t, is.DeepEqual(auth, actual)) |
| 120 | } |
| 121 | |
| 122 | func TestFileStoreGet(t *testing.T) { |
| 123 | f := &fakeStore{configs: map[string]types.AuthConfig{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…