MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / TestReadToken_FromFile

Function TestReadToken_FromFile

internal/nodeenroll/cmd_test.go:81–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

79}
80
81func TestReadToken_FromFile(t *testing.T) {
82 dir := t.TempDir()
83 p := filepath.Join(dir, "tok")
84 if err := os.WriteFile(p, []byte(" hello-token\n"), 0o600); err != nil {
85 t.Fatal(err)
86 }
87 got, err := readToken(p)
88 if err != nil {
89 t.Fatal(err)
90 }
91 if got != "hello-token" {
92 t.Errorf("got %q", got)
93 }
94}
95
96func TestReadToken_FromStdin(t *testing.T) {
97 r, w, err := os.Pipe()

Callers

nothing calls this directly

Calls 1

readTokenFunction · 0.85

Tested by

no test coverage detected