(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestNativeStoreAddCredentials(t *testing.T) { |
| 94 | f := &fakeStore{configs: map[string]types.AuthConfig{}} |
| 95 | s := &nativeStore{ |
| 96 | programFunc: mockCommandFn, |
| 97 | fileStore: NewFileStore(f), |
| 98 | } |
| 99 | auth := types.AuthConfig{ |
| 100 | Username: "foo", |
| 101 | Password: "bar", |
| 102 | ServerAddress: validServerAddress, |
| 103 | } |
| 104 | err := s.Store(auth) |
| 105 | assert.NilError(t, err) |
| 106 | assert.Check(t, is.Len(f.GetAuthConfigs(), 1)) |
| 107 | |
| 108 | actual, ok := f.GetAuthConfigs()[validServerAddress] |
| 109 | assert.Check(t, ok) |
| 110 | expected := types.AuthConfig{ |
| 111 | ServerAddress: auth.ServerAddress, |
| 112 | } |
| 113 | assert.Check(t, is.DeepEqual(expected, actual)) |
| 114 | } |
| 115 | |
| 116 | func TestNativeStoreAddInvalidCredentials(t *testing.T) { |
| 117 | f := &fakeStore{configs: map[string]types.AuthConfig{}} |
nothing calls this directly
no test coverage detected
searching dependent graphs…