1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-13 16:01:28 +05:30

Full implementation for OSX ready

Signed-off-by: avaid96 <avaid1996@gmail.com>
This commit is contained in:
avaid96
2016-07-11 10:50:44 -07:00
parent 5128fa1bad
commit 5a8fb214ed
7 changed files with 170 additions and 3 deletions
+18
View File
@@ -36,6 +36,11 @@ func (m *memoryStore) Get(serverURL string) (string, string, error) {
return c.Username, c.Secret, nil
}
func (m *memoryStore) List() ([]string, []string, error) {
//Simply a placeholder to let memoryStore be a valid implementation of Helper interface
return nil, nil, nil
}
func TestStore(t *testing.T) {
serverURL := "https://index.docker.io/v1/"
creds := &Credentials{
@@ -138,3 +143,16 @@ func TestErase(t *testing.T) {
t.Fatal("expected error getting missing creds, got empty")
}
}
func TestList(t *testing.T) {
//This tests that there is proper input an output into the byte stream
//Individual stores are very OS specific and have been tested in osxkeychain and secretservice respectively
out := new(bytes.Buffer)
h := newMemoryStore()
if err := List(h, out); err != nil {
t.Fatal(err)
}
if out.Len() == 0 {
t.Fatalf("expected output in the writer, got %d", 0)
}
}