mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
implementation on client side as well, complete with tests
Signed-off-by: avaid96 <avaid1996@gmail.com>
This commit is contained in:
@@ -70,6 +70,9 @@ func (m *mockProgram) Output() ([]byte, error) {
|
||||
default:
|
||||
return []byte("error storing credentials"), errProgramExited
|
||||
}
|
||||
case "list":
|
||||
return []byte(`{"Path":"e237574ae22fd53ddb9490dc1f72139946fd5372d42ba54d1eeb3ae5068fd22b","Username":"http://example.com/collections\u003cnotary_key\u003eSnapshot"}`), nil
|
||||
|
||||
}
|
||||
|
||||
return []byte(fmt.Sprintf("unknown argument %q with %q", m.arg, inS)), errProgramExited
|
||||
@@ -190,3 +193,9 @@ func TestErase(t *testing.T) {
|
||||
t.Fatalf("Expected error for server %s, got nil", invalidServerAddress)
|
||||
}
|
||||
}
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
if err := List(mockProgramFn); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user