MCPcopy
hub / github.com/smallstep/cli / TestReadPasswordFromFile

Function TestReadPasswordFromFile

utils/read_test.go:149–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestReadPasswordFromFile(t *testing.T) {
150 content := []byte("my-password-on-file\n")
151 f, cleanup := newFile(t, content)
152 defer cleanup()
153
154 b, err := ReadPasswordFromFile(f.Name())
155 require.NoError(t, err)
156 require.True(t, bytes.Equal([]byte("my-password-on-file"), b), "expected %s to equal %s", b, content)
157}
158
159func TestStringReadPasswordFromFile(t *testing.T) {
160 content := []byte("my-password-on-file\n")

Callers

nothing calls this directly

Calls 2

newFileFunction · 0.85
ReadPasswordFromFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…