mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
28 lines
476 B
Go
28 lines
476 B
Go
package askpass
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAdd(t *testing.T) {
|
|
t.Parallel()
|
|
s := NewServer(SocketPath)
|
|
nonce := s.Add("foo", "bar")
|
|
|
|
assert.Equal(t, "foo", s.creds[nonce].Username)
|
|
assert.Equal(t, "bar", s.creds[nonce].Password)
|
|
}
|
|
|
|
func TestRemove(t *testing.T) {
|
|
t.Parallel()
|
|
s := NewServer(SocketPath)
|
|
s.creds["some-id"] = Creds{Username: "foo"}
|
|
|
|
s.Remove("some-id")
|
|
|
|
_, ok := s.creds["some-id"]
|
|
assert.False(t, ok)
|
|
}
|